mbaedke commented on code in PR #2380: URL: https://github.com/apache/jackrabbit-oak/pull/2380#discussion_r2213060571
########## oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/JournalReader.java: ########## @@ -54,7 +55,13 @@ protected JournalEntry computeNext() { String line = null; while ((line = reader.readLine()) != null) { if (line.indexOf(' ') != -1) { - List<String> splits = Splitter.on(' ').splitToList(line); + List<String> splits; + if (line.trim().isEmpty()) { + // special case handling for empty lines where we need to split by space + splits = Arrays.stream(line.split("")).map(String::trim).collect(Collectors.toList()); + } else { + splits = Arrays.stream(line.split(" ")).collect(Collectors.toList()); + } Review Comment: Well, I tried the following in a JShell console in Idea; ``` import org.apache.jackrabbit.guava.common.base.Splitter; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; String separator = " "; String input = " "; List<String> guavaList = Splitter.on(separator).splitToList(input); System.out.println("Guava: " + guavaList.size()); List<String> jseList = Arrays.stream(" ".split("")).map(String::trim).collect(Collectors.toList()); System.out.println("Stream API: " + jseList.size()); ``` -- 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-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org