Skip to content

Commit

Permalink
Fixed erroneous JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
lhazlewood committed Sep 23, 2023
1 parent 0a44dc4 commit 4408369
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions api/src/main/java/io/jsonwebtoken/JwtBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
* {@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:</p>
* convenience method semantically equivalent to:
*
* <blockquote><pre>
* {@link #content(String) content(content)}.{@link #header()}.{@link HeaderMutator#contentType(String) contentType(cty)}.{@link BuilderHeader#and() and()}</pre></blockquote>
Expand Down Expand Up @@ -305,7 +305,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
* {@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:</p>
* convenience method semantically equivalent to:
*
* <blockquote><pre>
* {@link #content(byte[]) content(content)}.{@link #header()}.{@link HeaderMutator#contentType(String) contentType(cty)}.{@link BuilderHeader#and() and()}</pre></blockquote>
Expand Down Expand Up @@ -351,7 +351,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
* {@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:</p>
* convenience method semantically equivalent to:
*
* <blockquote><pre>
* {@link #content(InputStream) content(content)}.{@link #header()}.{@link HeaderMutator#contentType(String) contentType(cty)}.{@link BuilderHeader#and() and()}</pre></blockquote>
Expand Down
5 changes: 3 additions & 2 deletions api/src/main/java/io/jsonwebtoken/lang/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ public static void hasLength(String text) {
* be <code>null</code> and must contain at least one non-whitespace character.
* <pre class="code">Assert.hasText(name, "'name' must not be empty");</pre>
*
* @param text the String to check
* @param <T> 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 extends CharSequence> T hasText(T text, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4408369

Please sign in to comment.