Skip to content

Commit

Permalink
Remove Guava dependency and update to Java 9
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioweiler committed Jan 11, 2024
1 parent 5b420f9 commit 93a7cf5
Show file tree
Hide file tree
Showing 39 changed files with 700 additions and 698 deletions.
16 changes: 7 additions & 9 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ application while protecting against XSS.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<guava.version>30.1-jre</guava.version>
<maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target>
<maven.compiler.release>9</maven.compiler.release>
</properties>


<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -184,8 +187,8 @@ application while protecting against XSS.
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>6</source>
<target>6</target>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -234,15 +237,10 @@ application while protecting against XSS.

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>[1.4,)</version>
<version>[1.15,)</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>org.owasp.html</Export-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -81,10 +86,6 @@
</build>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/org/owasp/html/AttributePolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@

package org.owasp.html;

import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;

import java.util.List;
import java.util.Optional;
import java.util.Set;

import javax.annotation.CheckReturnValue;
Expand Down Expand Up @@ -91,11 +90,11 @@ static final class AttributePolicyJoiner
}

@Override
Optional<ImmutableList<AttributePolicy>> split(AttributePolicy x) {
Optional<List<AttributePolicy>> split(AttributePolicy x) {
if (x instanceof JoinedAttributePolicy) {
return Optional.of(((JoinedAttributePolicy) x).policies);
} else {
return Optional.absent();
return Optional.empty();
}
}

Expand Down
Loading

0 comments on commit 93a7cf5

Please sign in to comment.