Skip to content

Commit 2c24be2

Browse files
author
Jan Luehe
committed
Have org.apache.logging.log4j.util.Base64Util invoke java.util.Base64 directly instead of reflectively (#3686)
1 parent 0a860c5 commit 2c24be2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

log4j-api/src/main/java/org/apache/logging/log4j/util/Base64Util.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
public final class Base64Util {
2929

30-
private static final Base64.Encoder encoder = Base64.getEncoder();
30+
private static final Base64.Encoder ENCODER = Base64.getEncoder();
3131

3232
private Base64Util() {}
3333

@@ -37,6 +37,6 @@ private Base64Util() {}
3737
*/
3838
@Deprecated
3939
public static String encode(final String str) {
40-
return str != null ? encoder.encodeToString(str.getBytes(Charset.defaultCharset())) : null;
40+
return str != null ? ENCODER.encodeToString(str.getBytes(Charset.defaultCharset())) : null;
4141
}
4242
}

0 commit comments

Comments
 (0)