Fixed Javadoc and comment typos

Fixes: #294
This commit is contained in:
TK-one 2017-09-28 10:49:37 +09:00 committed by Brian Demers
parent ddeb39c557
commit 6fe3759d64
No known key found for this signature in database
GPG Key ID: 78A3F0D70AE5308C
3 changed files with 6 additions and 4 deletions

View File

@ -105,6 +105,7 @@ public interface Header<T extends Header<T>> extends Map<String,Object> {
* an example of a Nested JWT.</p>
*
* @param cty the JWT JOSE {@code cty} header value or {@code null} to remove the property from the JSON map.
* @return the {@code Header} instance for method chaining.
*/
T setContentType(String cty);
@ -119,12 +120,13 @@ public interface Header<T extends Header<T>> extends Map<String,Object> {
/**
* Sets the JWT <code>zip</code> (Compression Algorithm) header parameter value. A {@code null} value will remove
* the property from the JSON map.
* <p>
*
* <p>The compression algorithm is NOT part of the <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25">JWT specification</a>
* 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. </p>
*
* @param zip the JWT compression algorithm {@code zip} value or {@code null} to remove the property from the JSON map.
* @return the {@code Header} instance for method chaining.
* @since 0.6.0
*/
T setCompressionAlgorithm(String zip);

View File

@ -480,7 +480,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
* <p>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.
* However, be aware that <b>if you use compression when creating a JWS token, other libraries may not be able to
* parse that JWS token</b>. When using compression for JWS tokens, be sure that that all parties accessing the
* parse that JWS token</b>. When using compression for JWS tokens, be sure that all parties accessing the
* JWS token support compression for JWS.</p>
*
* <p>Compression when creating JWE tokens however should be universally accepted for any

View File

@ -83,13 +83,13 @@ public class JwtMap implements Map<String, Object> {
} else if (v instanceof Number) {
// https://github.com/jwtk/jjwt/issues/122:
// The JWT RFC *mandates* NumericDate values are represented as seconds.
// Because Because java.util.Date requires milliseconds, we need to multiply by 1000:
// Because java.util.Date requires milliseconds, we need to multiply by 1000:
long seconds = ((Number) v).longValue();
v = seconds * 1000;
} else if (v instanceof String) {
// https://github.com/jwtk/jjwt/issues/122
// The JWT RFC *mandates* NumericDate values are represented as seconds.
// Because Because java.util.Date requires milliseconds, we need to multiply by 1000:
// Because java.util.Date requires milliseconds, we need to multiply by 1000:
try {
long seconds = Long.parseLong((String) v);
v = seconds * 1000;