Skip to content

Commit 3b6cc1b

Browse files
Remove Guava dependency and update to Java 9 (#272)
1 parent 6b3cebd commit 3b6cc1b

39 files changed

+700
-698
lines changed

parent/pom.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ application while protecting against XSS.
8888
<properties>
8989
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9090
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
91-
<guava.version>30.1-jre</guava.version>
91+
<maven.compiler.source>9</maven.compiler.source>
92+
<maven.compiler.target>9</maven.compiler.target>
93+
<maven.compiler.release>9</maven.compiler.release>
9294
</properties>
9395

96+
9497
<build>
9598
<pluginManagement>
9699
<plugins>
@@ -184,8 +187,8 @@ application while protecting against XSS.
184187
<artifactId>maven-compiler-plugin</artifactId>
185188
<version>3.3</version>
186189
<configuration>
187-
<source>6</source>
188-
<target>6</target>
190+
<source>9</source>
191+
<target>9</target>
189192
</configuration>
190193
</plugin>
191194
<plugin>
@@ -234,15 +237,10 @@ application while protecting against XSS.
234237

235238
<dependencyManagement>
236239
<dependencies>
237-
<dependency>
238-
<groupId>com.google.guava</groupId>
239-
<artifactId>guava</artifactId>
240-
<version>${guava.version}</version>
241-
</dependency>
242240
<dependency>
243241
<groupId>commons-codec</groupId>
244242
<artifactId>commons-codec</artifactId>
245-
<version>[1.4,)</version>
243+
<version>[1.15,)</version>
246244
</dependency>
247245
<dependency>
248246
<groupId>com.google.code.findbugs</groupId>

pom.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
<plugin>
6161
<groupId>org.apache.felix</groupId>
6262
<artifactId>maven-bundle-plugin</artifactId>
63+
<configuration>
64+
<instructions>
65+
<Export-Package>org.owasp.html</Export-Package>
66+
</instructions>
67+
</configuration>
6368
</plugin>
6469
<plugin>
6570
<groupId>org.apache.maven.plugins</groupId>
@@ -81,10 +86,6 @@
8186
</build>
8287

8388
<dependencies>
84-
<dependency>
85-
<groupId>com.google.guava</groupId>
86-
<artifactId>guava</artifactId>
87-
</dependency>
8889
<dependency>
8990
<groupId>commons-codec</groupId>
9091
<artifactId>commons-codec</artifactId>

src/main/java/org/owasp/html/AttributePolicy.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828

2929
package org.owasp.html;
3030

31-
import com.google.common.base.Optional;
32-
import com.google.common.collect.ImmutableList;
33-
31+
import java.util.List;
32+
import java.util.Optional;
3433
import java.util.Set;
3534

3635
import javax.annotation.CheckReturnValue;
@@ -91,11 +90,11 @@ static final class AttributePolicyJoiner
9190
}
9291

9392
@Override
94-
Optional<ImmutableList<AttributePolicy>> split(AttributePolicy x) {
93+
Optional<List<AttributePolicy>> split(AttributePolicy x) {
9594
if (x instanceof JoinedAttributePolicy) {
9695
return Optional.of(((JoinedAttributePolicy) x).policies);
9796
} else {
98-
return Optional.absent();
97+
return Optional.empty();
9998
}
10099
}
101100

0 commit comments

Comments
 (0)