From 91fd0fd3b4337bcfc5921f4c640d20db3dd31c08 Mon Sep 17 00:00:00 2001 From: Micah Silverman Date: Mon, 9 Oct 2017 20:15:18 -0400 Subject: [PATCH] Added support for Java 9 build and test run. Does not impact Java 8 build and test. Overrode some OSS version dependency version defaults to support Java 9. Updated javadocs in code to pass java 9 linter. --- pom.xml | 49 +++++++++++++++++-- src/main/java/io/jsonwebtoken/Claims.java | 2 +- .../io/jsonwebtoken/CompressionCodecs.java | 2 +- src/main/java/io/jsonwebtoken/Header.java | 4 +- src/main/java/io/jsonwebtoken/JwtBuilder.java | 2 +- src/main/java/io/jsonwebtoken/JwtParser.java | 6 +-- .../io/jsonwebtoken/SignatureAlgorithm.java | 1 + .../io/jsonwebtoken/SigningKeyResolver.java | 2 +- .../jsonwebtoken/impl/crypto/MacProvider.java | 2 +- .../java/io/jsonwebtoken/lang/Strings.java | 8 +-- 10 files changed, 59 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index f313eff4..8b64e759 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 3.0.2 3.6.1 - 1.6 + 1.8 UTF-8 ${user.name}-${maven.build.timestamp} @@ -92,10 +92,11 @@ 2.4.11 1.2.3 - 3.4 + 3.5 4.12 - 1.6.6 - 2.19.1 + 2.0.0-beta.5 + 2.20.1 + 2.20.1 4.2.0 @@ -267,10 +268,16 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + org.apache.maven.plugins maven-failsafe-plugin - 2.20 + ${failsafe.plugin.version} **/*IT.java @@ -363,6 +370,7 @@ + org.jwtk.coveralls @@ -370,6 +378,29 @@ 4.4.0 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + + commons-lang + commons-lang + 2.6 + + + @@ -433,6 +464,14 @@ + + + + commons-lang + commons-lang + 2.6 + + diff --git a/src/main/java/io/jsonwebtoken/Claims.java b/src/main/java/io/jsonwebtoken/Claims.java index 22a3e364..67fb4486 100644 --- a/src/main/java/io/jsonwebtoken/Claims.java +++ b/src/main/java/io/jsonwebtoken/Claims.java @@ -31,7 +31,7 @@ import java.util.Map; * claims.{@link Map#put(Object, Object) put}("someKey", "someValue"); * * - *

Creation

+ *

Creation

* *

It is easiest to create a {@code Claims} instance by calling one of the * {@link Jwts#claims() JWTs.claims()} factory methods.

diff --git a/src/main/java/io/jsonwebtoken/CompressionCodecs.java b/src/main/java/io/jsonwebtoken/CompressionCodecs.java index 779f9893..4374197a 100644 --- a/src/main/java/io/jsonwebtoken/CompressionCodecs.java +++ b/src/main/java/io/jsonwebtoken/CompressionCodecs.java @@ -24,7 +24,7 @@ public final class CompressionCodecs { /** * Codec implementing the gzip compression algorithm. - *
Compatibility Warning
+ *

Compatibility Warning

*

This is not a standard JWA compression algorithm. Be sure to use this only when you are confident * that all parties accessing the token support the gzip algorithm.

*

If you're concerned about compatibility, the {@link #DEFLATE DEFLATE} code is JWA standards-compliant.

diff --git a/src/main/java/io/jsonwebtoken/Header.java b/src/main/java/io/jsonwebtoken/Header.java index 05876b82..1e7687bc 100644 --- a/src/main/java/io/jsonwebtoken/Header.java +++ b/src/main/java/io/jsonwebtoken/Header.java @@ -30,7 +30,7 @@ import java.util.Map; * header.{@link Map#put(Object, Object) put}("headerParamName", "headerParamValue"); * * - *

Creation

+ *

Creation

* *

It is easiest to create a {@code Header} instance by calling one of the * {@link Jwts#header() JWTs.header()} factory methods.

@@ -120,7 +120,7 @@ public interface Header> extends Map { * Sets the JWT calg (Compression Algorithm) header parameter value. A {@code null} value will remove * the property from the JSON map. *

- *

The compression algorithm is NOT part of the JWT specification * and must be used carefully since, is not expected that other libraries (including previous versions of this one) * be able to deserialize a compressed JTW body correctly.

* diff --git a/src/main/java/io/jsonwebtoken/JwtBuilder.java b/src/main/java/io/jsonwebtoken/JwtBuilder.java index 4cb012f2..5626218c 100644 --- a/src/main/java/io/jsonwebtoken/JwtBuilder.java +++ b/src/main/java/io/jsonwebtoken/JwtBuilder.java @@ -368,7 +368,7 @@ public interface JwtBuilder extends ClaimsMutator { * can be useful. For example, when embedding JWTs in URLs, some browsers may not support URLs longer than a * certain length. Using compression can help ensure the compact JWT fits within that length. However, NOTE:

* - *
Compatibility Warning
+ *

Compatibility Warning

* *

The JWT family of specifications defines compression only for JWE (Json Web Encryption) * tokens. Even so, JJWT will also support compression for JWS tokens as well if you choose to use it. diff --git a/src/main/java/io/jsonwebtoken/JwtParser.java b/src/main/java/io/jsonwebtoken/JwtParser.java index c0fa1603..1dcdcf58 100644 --- a/src/main/java/io/jsonwebtoken/JwtParser.java +++ b/src/main/java/io/jsonwebtoken/JwtParser.java @@ -228,10 +228,10 @@ public interface JwtParser { * Sets the {@link CompressionCodecResolver} used to acquire the {@link CompressionCodec} that should be used to * decompress the JWT body. If the parsed JWT is not compressed, this resolver is not used. *

NOTE: Compression is not defined by the JWT Specification, and it is not expected that other libraries - * (including JJWT versions < 0.6.0) are able to consume a compressed JWT body correctly. This method is only - * useful if the compact JWT was compressed with JJWT >= 0.6.0 or another library that you know implements + * (including JJWT versions < 0.6.0) are able to consume a compressed JWT body correctly. This method is only + * useful if the compact JWT was compressed with JJWT >= 0.6.0 or another library that you know implements * the same behavior.

- *
Default Support
+ *

Default Support

*

JJWT's default {@link JwtParser} implementation supports both the * {@link io.jsonwebtoken.impl.compression.DeflateCompressionCodec DEFLATE} * and {@link io.jsonwebtoken.impl.compression.GzipCompressionCodec GZIP} algorithms by default - you do not need to diff --git a/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java b/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java index 7f5388f7..a44c0b15 100644 --- a/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java +++ b/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java @@ -130,6 +130,7 @@ public enum SignatureAlgorithm { * following table: * * + * * * * diff --git a/src/main/java/io/jsonwebtoken/SigningKeyResolver.java b/src/main/java/io/jsonwebtoken/SigningKeyResolver.java index b068db9d..fbd9887f 100644 --- a/src/main/java/io/jsonwebtoken/SigningKeyResolver.java +++ b/src/main/java/io/jsonwebtoken/SigningKeyResolver.java @@ -38,7 +38,7 @@ import java.security.Key; * *

A {@code SigningKeyResolver} is invoked once during parsing before the signature is verified.

* - *

SigningKeyResolverAdapter

+ *

SigningKeyResolverAdapter

* *

If you only need to resolve a signing key for a particular JWS (either a plaintext or Claims JWS), consider using * the {@link io.jsonwebtoken.SigningKeyResolverAdapter} and overriding only the method you need to support instead of diff --git a/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java b/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java index 1ce280bb..aa731e3d 100644 --- a/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java +++ b/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java @@ -67,7 +67,7 @@ public abstract class MacProvider extends SignatureProvider { * according to the specified {@code SignatureAlgorithm} using the specified SecureRandom number generator. This * implementation returns secure-random key sizes as follows: * - *

Crypto Family
SignatureAlgorithm
+ *
Signature Algorithm Generated Key Size
* *
Key Sizes
Signature Algorithm Generated Key Size
HS256 256 bits (32 bytes)
HS384 384 bits (48 bytes)
HS512 512 bits (64 bytes)
* diff --git a/src/main/java/io/jsonwebtoken/lang/Strings.java b/src/main/java/io/jsonwebtoken/lang/Strings.java index a93cf340..338803f9 100644 --- a/src/main/java/io/jsonwebtoken/lang/Strings.java +++ b/src/main/java/io/jsonwebtoken/lang/Strings.java @@ -438,7 +438,7 @@ public final class Strings { * Quote the given String with single quotes. * @param str the input String (e.g. "myString") * @return the quoted String (e.g. "'myString'"), - * or null if the input was null + * or null if the input was null */ public static String quote(String str) { return (str != null ? "'" + str + "'" : null); @@ -513,7 +513,7 @@ public final class Strings { /** * Extract the filename from the given path, - * e.g. "mypath/myfile.txt" -> "myfile.txt". + * e.g. "mypath/myfile.txt" -> "myfile.txt". * @param path the file path (may be null) * @return the extracted filename, or null if none */ @@ -527,7 +527,7 @@ public final class Strings { /** * Extract the filename extension from the given path, - * e.g. "mypath/myfile.txt" -> "txt". + * e.g. "mypath/myfile.txt" -> "txt". * @param path the file path (may be null) * @return the extracted filename extension, or null if none */ @@ -548,7 +548,7 @@ public final class Strings { /** * Strip the filename extension from the given path, - * e.g. "mypath/myfile.txt" -> "mypath/myfile". + * e.g. "mypath/myfile.txt" -> "mypath/myfile". * @param path the file path (may be null) * @return the path with stripped filename extension, * or null if none