Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ public static TransportVersionDefinition fromString(Path file, String contents,

String idsLine = null;
if (contents.isEmpty() == false) {
String[] lines = contents.split(System.lineSeparator());
// Regardless of whether windows newlines exist (they could be added by git), we split on line feed.
// All we care about skipping lines with the comment character, so the remaining \r won't matter
String[] lines = contents.split("\n");
for (String line : lines) {
line = line.replaceAll("\\s+", "");
line = line.strip();
if (line.startsWith("#") == false) {
idsLine = line;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ public static TransportVersionUpperBound fromString(Path file, String contents)
String branch = filename.substring(slashIndex == -1 ? 0 : (slashIndex + 1), filename.length() - 4);

String idsLine = null;
String[] lines = contents.split(System.lineSeparator());
// Regardless of whether windows newlines exist (they could be added by git), we split on line feed.
// All we care about skipping lines with the comment character, so the remaining \r won't matter
String[] lines = contents.split("\n");
for (String line : lines) {
line = line.replaceAll("\\s+", "");
line = line.strip();
if (line.startsWith("#") == false) {
idsLine = line;
break;
Expand Down