remove Apache Commons Codec dependency#1256
Conversation
| */ | ||
| public SecretSpec withData(String data) { | ||
| this.data = Base64.encodeBase64String(data.getBytes()); | ||
| this.data = Base64.getEncoder().encodeToString(data.getBytes()); |
There was a problem hiding this comment.
we had issues with encoders, are they 100% same?
There was a problem hiding this comment.
if you had issues, why did you add a test? ;)
It should be. Any idea how to test?
There was a problem hiding this comment.
Not sure with this case, but they are generally not same - with JDK encoder you have better API and you need only to select the right encoder for the purpose. They differ in splitting to lines, for example. See Base64 sources and RFC or write some trivial test to compare.
Btw, problems are usually connected with the usage String.getBytes, because it depends on default system encoding (UTF-8/ISO-8859-2/ISO-8859-1/...?).
Codecov Report
@@ Coverage Diff @@
## master #1256 +/- ##
======================================
Coverage 75% 75%
======================================
Files 1 1
Lines 16 16
======================================
Hits 12 12
Misses 3 3
Partials 1 1Continue to review full report at Codecov.
|
After #1249, we can use Java's built-in Base64 support and remove the codec dependency completely
This change is