From 4408369bfffa0c7a9a2ac7fd6e9952f2ba96f735 Mon Sep 17 00:00:00 2001
From: Les Hazlewood <121180+lhazlewood@users.noreply.github.com>
Date: Sat, 23 Sep 2023 09:35:07 -0700
Subject: [PATCH] Fixed erroneous JavaDoc
---
api/src/main/java/io/jsonwebtoken/JwtBuilder.java | 6 +++---
api/src/main/java/io/jsonwebtoken/lang/Assert.java | 5 +++--
.../main/java/io/jsonwebtoken/impl/DefaultJwtBuilder.java | 3 +--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/api/src/main/java/io/jsonwebtoken/JwtBuilder.java b/api/src/main/java/io/jsonwebtoken/JwtBuilder.java
index 3a8e6e010..7d46cc341 100644
--- a/api/src/main/java/io/jsonwebtoken/JwtBuilder.java
+++ b/api/src/main/java/io/jsonwebtoken/JwtBuilder.java
@@ -258,7 +258,7 @@ public interface JwtBuilder extends ClaimsMutator {
* {@link HeaderMutator#contentType(String) contentType} header value to a compact {@code cty} IANA Media Type
* identifier to indicate the data format of the resulting byte array. The JWT recipient can inspect the
* {@code cty} value to determine how to convert the byte array to the final content type as desired. This is a
- * convenience method semantically equivalent to:
+ * convenience method semantically equivalent to:
*
*
* {@link #content(String) content(content)}.{@link #header()}.{@link HeaderMutator#contentType(String) contentType(cty)}.{@link BuilderHeader#and() and()}
@@ -305,7 +305,7 @@ public interface JwtBuilder extends ClaimsMutator {
* {@link HeaderMutator#contentType(String) contentType} header value to a compact {@code cty} IANA Media Type
* identifier to indicate the data format of the byte array. The JWT recipient can inspect the
* {@code cty} value to determine how to convert the byte array to the final content type as desired. This is a
- * convenience method semantically equivalent to:
+ * convenience method semantically equivalent to:
*
*
* {@link #content(byte[]) content(content)}.{@link #header()}.{@link HeaderMutator#contentType(String) contentType(cty)}.{@link BuilderHeader#and() and()}
@@ -351,7 +351,7 @@ public interface JwtBuilder extends ClaimsMutator {
* {@link BuilderHeader#contentType(String) contentType} header value to a compact {@code cty} IANA Media Type
* identifier to indicate the data format of the byte array. The JWT recipient can inspect the
* {@code cty} value to determine how to convert the byte array to the final content type as desired. This is a
- * convenience method semantically equivalent to:
+ * convenience method semantically equivalent to:
*
*
* {@link #content(InputStream) content(content)}.{@link #header()}.{@link HeaderMutator#contentType(String) contentType(cty)}.{@link BuilderHeader#and() and()}
diff --git a/api/src/main/java/io/jsonwebtoken/lang/Assert.java b/api/src/main/java/io/jsonwebtoken/lang/Assert.java
index 7c97f856c..78c99b4f1 100644
--- a/api/src/main/java/io/jsonwebtoken/lang/Assert.java
+++ b/api/src/main/java/io/jsonwebtoken/lang/Assert.java
@@ -140,9 +140,10 @@ public static void hasLength(String text) {
* be null
and must contain at least one non-whitespace character.
* Assert.hasText(name, "'name' must not be empty");
*
- * @param text the String to check
+ * @param the type of CharSequence
+ * @param text the CharSequence to check
* @param message the exception message to use if the assertion fails
- * @return the string if it has text
+ * @return the CharSequence if it has text
* @see Strings#hasText
*/
public static T hasText(T text, String message) {
diff --git a/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtBuilder.java b/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtBuilder.java
index a16103332..d31b933f6 100644
--- a/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtBuilder.java
+++ b/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtBuilder.java
@@ -761,8 +761,7 @@ private String encrypt(final Payload content, final Key key, final Provider keyP
ByteArrayOutputStream jwe = new ByteArrayOutputStream(4096);
OutputStream out = this.encoder.wrap(jwe); // automatically base64url-encode as we write
- writeAndClose(out, header);
- Objects.nullSafeClose(out); // closes/flushes the 'out' (base64url-encoding) stream, not 'jwe' (since BAOSs don't close)
+ writeAndClose(out, header); // closes/flushes the base64url-encoding stream, not 'jwe' (since BAOSs don't close)
// JWE RFC requires AAD to be the ASCII bytes of the Base64URL-encoded header. Since the header bytes are
// already Base64URL-encoded at this point (via the encoder.wrap call just above), and Base64Url-encoding uses