Skip to content

Commit

Permalink
RedisURI: improve deprecation notice in withPassword()
Browse files Browse the repository at this point in the history
  • Loading branch information
perlun committed Apr 6, 2021
1 parent 6637074 commit cd91dde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/io/lettuce/core/RedisURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -1518,9 +1518,14 @@ 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}).
*
* @param password the password
* @return the builder
* @deprecated since 6.0. Use {@link #withPassword(CharSequence)} or {@link #withPassword(char[])} 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 cd91dde

Please sign in to comment.