[#8336] DDLDatabase cannot load relative paths in Maven modules that do not contain wildcards

This commit is contained in:
lukaseder 2019-02-19 10:42:52 +01:00
parent 426cc96ff7
commit e37788981d

View File

@ -112,8 +112,14 @@ public final class FilePattern {
load(encoding, file, fileComparator, null, loader);
loaded = true;
}
else if (pattern.contains("*") || pattern.contains("?")) {
file = new File(pattern.replaceAll("[*?].*", "")).getCanonicalFile();
else {
// [#8336] Relative paths aren't necessarily relative to the
// working directory, but maybe to some subdirectory
if (pattern.contains("*") || pattern.contains("?"))
file = new File(pattern.replaceAll("[*?].*", "")).getCanonicalFile();
else
file = new File(".").getCanonicalFile();
Pattern regex = Pattern.compile("^.*?"
+ pattern