diff --git a/src/main/java/io/lettuce/core/RedisURI.java b/src/main/java/io/lettuce/core/RedisURI.java index c3803b4fb3..d582de7d42 100644 --- a/src/main/java/io/lettuce/core/RedisURI.java +++ b/src/main/java/io/lettuce/core/RedisURI.java @@ -445,9 +445,13 @@ public char[] getPassword() { /** * Sets the password. Use empty string to skip 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, 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) { @@ -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}). + *
+ * 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) {