8139607: -release option forces StandardJavaFileManager

Merging a --release specific file manager with the user-provided one, rather than altering the user-provided one.

Reviewed-by: jjg, mcimadamore
This commit is contained in:
Jan Lahoda 2017-11-06 13:10:43 +01:00
parent b97f1bcb37
commit 5f97b69390
15 changed files with 577 additions and 150 deletions

View file

@ -123,8 +123,11 @@ public class SetLocationForModule extends TestRunner {
checkEqual("override setting 2",
fm2.getLocationAsPaths(m), override1);
Location firstLocation =
fm2.listLocationsForModules(locn).iterator().next().iterator().next();
checkEqual("override setting 2b",
fm2.getLocationAsPaths(fm2.listLocationsForModules(locn).iterator().next().iterator().next()),
fm2.getLocationAsPaths(firstLocation),
override1);
}
@ -214,6 +217,19 @@ public class SetLocationForModule extends TestRunner {
fm.getLocationAsPaths(fm.listLocationsForModules(locn).iterator().next().iterator().next()),
override1);
try (StandardJavaFileManager fm2 = comp.getStandardFileManager(null, null, null)) {
fm2.setLocationForModule(locn, "m", List.of(override1));
checkEqual("override setting 1",
fm2.getLocationAsPaths(m), override1);
Location firstLocation =
fm2.listLocationsForModules(locn).iterator().next().iterator().next();
checkEqual("override setting 1b",
fm2.getLocationAsPaths(firstLocation),
override1);
}
Path override2 = Files.createDirectories(base.resolve("override2"));
fm.setLocationFromPaths(m, List.of(override2));
checkEqual("override setting 2",