Skip to content

Commit

Permalink
Polishing #1707
Browse files Browse the repository at this point in the history
Update documentation of the setter. Reformat code.
  • Loading branch information
mp911de committed Apr 7, 2021
1 parent 4df68a7 commit 71e0fae
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/main/java/io/lettuce/core/RedisURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,13 @@ public char[] getPassword() {

/**
* Sets the password. Use empty string to skip authentication.
* <p>
* This method is deprecated as of Lettuce 6.0. The reason is that {@link String} has a strong caching affinity and the JVM
* cannot easily GC {@code String} instances. Therefore we suggest using either {@code char[]} or a custom
* {@link CharSequence} (e.g. {@link StringBuilder} or netty's {@link io.netty.util.AsciiString}).
*
* @param password the password, must not be {@code null}.
* @deprecated since 6.0. Use {@link #setPassword(CharSequence)} or {@link #setPassword(char[])} avoid String caching.
* @deprecated since 6.0. Use {@link #setPassword(CharSequence)} or {@link #setPassword(char[])} to avoid String caching.
*/
@Deprecated
public void setPassword(String password) {
Expand Down Expand Up @@ -1517,15 +1521,15 @@ public Builder withAuthentication(String username, char[] password) {

/**
* Configures authentication.
*
* This method is deprecated as of Lettuce 6.0. The reason is that {@link String} has a
* strong caching affinity and the JVM cannot easily GC {@code String} instances. Therefore
* we suggest using either {@code char[]} or a custom {@link CharSequence} (e.g. {@link
* StringBuilder} or netty's {@link io.netty.util.AsciiString}).
* <p>
* This method is deprecated as of Lettuce 6.0. The reason is that {@link String} has a strong caching affinity and the
* JVM cannot easily GC {@code String} instances. Therefore we suggest using either {@code char[]} or a custom
* {@link CharSequence} (e.g. {@link StringBuilder} or netty's {@link io.netty.util.AsciiString}).
*
* @param password the password
* @return the builder
* @deprecated since 6.0. Use {@link #withPassword(CharSequence)} or {@link #withPassword(char[])} to avoid String caching.
* @deprecated since 6.0. Use {@link #withPassword(CharSequence)} or {@link #withPassword(char[])} to avoid String
* caching.
*/
@Deprecated
public Builder withPassword(String password) {
Expand Down

0 comments on commit 71e0fae

Please sign in to comment.