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 @@ -20,8 +20,19 @@ public static TransportVersionDefinition fromString(Path file, String contents)
String name = filename.substring(0, filename.length() - 4);
List<TransportVersionId> ids = new ArrayList<>();

String idsLine = null;
if (contents.isEmpty() == false) {
for (String rawId : contents.split(",")) {
String[] lines = contents.split(System.lineSeparator());
for (String line : lines) {
line = line.replaceAll("\\s+", "");
if (line.startsWith("#") == false) {
idsLine = line;
break;
}
}
}
if (idsLine != null) {
for (String rawId : idsLine.split(",")) {
try {
ids.add(TransportVersionId.fromString(rawId));
} catch (NumberFormatException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ public static TransportVersionUpperBound fromString(Path file, String contents)
int slashIndex = filename.lastIndexOf('/');
String branch = filename.substring(slashIndex == -1 ? 0 : (slashIndex + 1), filename.length() - 4);

String[] parts = contents.split(",");
String idsLine = null;
String[] lines = contents.split(System.lineSeparator());
for (String line : lines) {
line = line.replaceAll("\\s+", "");
if (line.startsWith("#") == false) {
idsLine = line;
break;
}
}
String[] parts = idsLine.split(",");
if (parts.length != 2) {
throw new IllegalStateException("Invalid transport version upper bound file [" + file + "]: " + contents);
}
Expand Down