reschke commented on code in PR #2380:
URL: https://github.com/apache/jackrabbit-oak/pull/2380#discussion_r2197851135
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/DataStoreCommand.java:
##########
@@ -574,8 +575,6 @@ static class VerboseIdLogger {
return s1.split(DELIM)[0].compareTo(s2.split(DELIM)[0]);
}
};
- private final static Splitter delimSplitter =
Splitter.on(DELIM).trimResults().omitEmptyStrings();
-
Review Comment:
Would it be possible to transform this into a Function in order to avoid
repetition?
##########
oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/FileIOUtilsTest.java:
##########
@@ -96,7 +95,11 @@ public void writeCustomReadOrgStrings() throws Exception {
File f = folder.newFile();
int count = writeStrings(added.iterator(), f, false, new
java.util.function.Function<String, String>() {
@Nullable @Override public String apply(@Nullable String input) {
- return
Splitter.on("-").trimResults().omitEmptyStrings().splitToList(input).get(0);
+ return Arrays.stream(input.split("-"))
+ .map(String::trim)
+ .filter(s -> !s.isEmpty())
+ .findFirst()
+ .orElse(null);
Review Comment:
What's this? I assume it's ok but I do not understand :-)
##########
oak-run/src/test/java/org/apache/jackrabbit/oak/run/DataStoreCommandTest.java:
##########
@@ -763,7 +762,7 @@ private void testDumpRef(File dump, Data data, boolean
verbose, boolean verboseR
storeFixture.getConnectionString(), "--out-dir",
dump.getAbsolutePath(), "--work-dir",
temporaryFolder.newFolder().getAbsolutePath()));
if (!StringUtils.isEmpty(additionalParams)) {
- argsList.addAll(Splitter.on(" ").splitToList(additionalParams));
+ argsList.addAll(Arrays.stream(additionalParams.split("
")).collect(Collectors.toList()));
Review Comment:
that's a SP, right?
##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/SharedDataStoreUtils.java:
##########
@@ -117,8 +117,11 @@ public String getType() {
}
public String getIdFromName(String name) {
- return Splitter.on("_").limit(2).splitToList(
- Splitter.on(DELIM).limit(2).splitToList(name).get(1)).get(0);
+ return Arrays.stream(name.split(DELIM, 2))
+ .skip(1)
+ .findFirst()
Review Comment:
is this reight as compared to "limit(2)?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]