[splitting] Validate ambiguous specifications in splitting.txt

This commit is contained in:
Miro Spönemann 2016-06-13 14:17:56 +02:00
parent 5aaf2da7bd
commit 078434360b

View file

@ -57,8 +57,17 @@ public class ValidateSplitting {
}
}
// Check whether each file has a specified path as prefix
// Check whether any path has an ambiguous specification
final Pattern segmentPattern = Pattern.compile("/");
for (String path : specifiedPaths) {
Matcher matcher = segmentPattern.matcher(path);
while (matcher.find()) {
if (specifiedPaths.contains(path.substring(0, matcher.start())))
fail("Path has ambiguous specification: " + path);
}
}
// Check whether each file has a specified path as prefix
try (BufferedReader reader = new BufferedReader(new FileReader(outputDir + "/" + FindProjects.ALL_FILES))) {
String line;
while ((line = reader.readLine()) != null) {