793 }
794
795 private void lazy() {
796 if (searchPath == null) {
797 try {
798 searchPath = Collections.unmodifiableCollection(computePath());
799 } catch (IOException e) {
800 // TODO: need better handling here, e.g. javac Abort?
801 throw new UncheckedIOException(e);
802 }
803 }
804 }
805 }
806
807 /**
808 * A LocationHander to represent modules found from a module-oriented
809 * location such as MODULE_SOURCE_PATH, UPGRADE_MODULE_PATH,
810 * SYSTEM_MODULES and MODULE_PATH.
811 *
812 * The Location can be specified to accept overriding classes from the
813 * {@code -Xpatch:<module>=<path> } parameter.
814 */
815 private class ModuleLocationHandler extends LocationHandler implements Location {
816 protected final String name;
817 protected final String moduleName;
818 protected final Collection<Path> searchPath;
819 protected final Collection<Path> searchPathWithOverrides;
820 protected final boolean output;
821
822 ModuleLocationHandler(String name, String moduleName, Collection<Path> searchPath,
823 boolean output, boolean allowOverrides) {
824 this.name = name;
825 this.moduleName = moduleName;
826 this.searchPath = searchPath;
827 this.output = output;
828
829 if (allowOverrides && patchMap != null) {
830 SearchPath mPatch = patchMap.get(moduleName);
831 if (mPatch != null) {
832 SearchPath sp = new SearchPath();
833 sp.addAll(mPatch);
|
793 }
794
795 private void lazy() {
796 if (searchPath == null) {
797 try {
798 searchPath = Collections.unmodifiableCollection(computePath());
799 } catch (IOException e) {
800 // TODO: need better handling here, e.g. javac Abort?
801 throw new UncheckedIOException(e);
802 }
803 }
804 }
805 }
806
807 /**
808 * A LocationHander to represent modules found from a module-oriented
809 * location such as MODULE_SOURCE_PATH, UPGRADE_MODULE_PATH,
810 * SYSTEM_MODULES and MODULE_PATH.
811 *
812 * The Location can be specified to accept overriding classes from the
813 * {@code --patch-module <module>=<path> } parameter.
814 */
815 private class ModuleLocationHandler extends LocationHandler implements Location {
816 protected final String name;
817 protected final String moduleName;
818 protected final Collection<Path> searchPath;
819 protected final Collection<Path> searchPathWithOverrides;
820 protected final boolean output;
821
822 ModuleLocationHandler(String name, String moduleName, Collection<Path> searchPath,
823 boolean output, boolean allowOverrides) {
824 this.name = name;
825 this.moduleName = moduleName;
826 this.searchPath = searchPath;
827 this.output = output;
828
829 if (allowOverrides && patchMap != null) {
830 SearchPath mPatch = patchMap.get(moduleName);
831 if (mPatch != null) {
832 SearchPath sp = new SearchPath();
833 sp.addAll(mPatch);
|