You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "reschke (via GitHub)" <gi...@apache.org> on 2025/01/16 14:21:35 UTC
[PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
reschke opened a new pull request, #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#issuecomment-2599782239
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [50.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#issuecomment-2595860652
# Commit-Check ✔️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#discussion_r1920119533
##########
oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java:
##########
@@ -119,6 +120,11 @@ public abstract class AbstractBlobStore implements GarbageCollectableBlobStore,
*/
private int blockSize = 2 * 1024 * 1024;
+ /**
+ * Encode in Base 32, hex encoding, no line breaks, padding with "="
+ */
+ private static Base32 BASE32ENCODER = Base32.builder().setLineSeparator(new byte[0]).setPadding((byte)'=').get();
+
Review Comment:
Yes, that's a design flaw in the builder API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#discussion_r1918685892
##########
oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java:
##########
@@ -119,6 +120,11 @@ public abstract class AbstractBlobStore implements GarbageCollectableBlobStore,
*/
private int blockSize = 2 * 1024 * 1024;
+ /**
+ * Encode in Base 32, hex encoding, no line breaks, padding with "="
+ */
+ private static Base32 BASE32ENCODER = Base32.builder().setLineSeparator(new byte[0]).setPadding((byte)'=').get();
+
Review Comment:
Isn't there `.setEncodeTable(...)` missing?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#issuecomment-2596362778
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke merged PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#discussion_r1920122466
##########
oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java:
##########
@@ -237,7 +244,7 @@ public String getReference(@NotNull String blobId) {
Mac mac = Mac.getInstance(ALGORITHM);
mac.init(new SecretKeySpec(getReferenceKey(), ALGORITHM));
byte[] hash = mac.doFinal(blobId.getBytes("UTF-8"));
- return blobId + ':' + BaseEncoding.base32Hex().encode(hash);
+ return ':' + BASE32ENCODER.encodeToString(hash);
Review Comment:
It used to be: return blobId + ':' +...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#issuecomment-2598554002
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [50.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1992)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#discussion_r1920089833
##########
oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java:
##########
@@ -119,6 +120,11 @@ public abstract class AbstractBlobStore implements GarbageCollectableBlobStore,
*/
private int blockSize = 2 * 1024 * 1024;
+ /**
+ * Encode in Base 32, hex encoding, no line breaks, padding with "="
+ */
+ private static Base32 BASE32ENCODER = Base32.builder().setLineSeparator(new byte[0]).setPadding((byte)'=').get();
+
Review Comment:
It was.
I now changed to the old-style constructor, because we otherwise would have to speficy the actual values (the constants in the Base32 class are private).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#discussion_r1920132802
##########
oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java:
##########
@@ -237,7 +244,7 @@ public String getReference(@NotNull String blobId) {
Mac mac = Mac.getInstance(ALGORITHM);
mac.init(new SecretKeySpec(getReferenceKey(), ALGORITHM));
byte[] hash = mac.doFinal(blobId.getBytes("UTF-8"));
- return blobId + ':' + BaseEncoding.base32Hex().encode(hash);
+ return ':' + BASE32ENCODER.encodeToString(hash);
Review Comment:
oh, so much for opening PRs while tests are still running, and making last-second changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11399: Remove usage of Guava io.BaseEncoding [jackrabbit-oak]
Posted by "mbaedke (via GitHub)" <gi...@apache.org>.
mbaedke commented on code in PR #1992:
URL: https://github.com/apache/jackrabbit-oak/pull/1992#discussion_r1918685892
##########
oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java:
##########
@@ -119,6 +120,11 @@ public abstract class AbstractBlobStore implements GarbageCollectableBlobStore,
*/
private int blockSize = 2 * 1024 * 1024;
+ /**
+ * Encode in Base 32, hex encoding, no line breaks, padding with "="
+ */
+ private static Base32 BASE32ENCODER = Base32.builder().setLineSeparator(new byte[0]).setPadding((byte)'=').get();
+
Review Comment:
Fehlt da nicht .setEncodeTable(...) ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org