Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
8182162: Remove -XD-Xmodule
Browse files Browse the repository at this point in the history
Summary: Removing the undocumented -XD-Xmodule: option.
Reviewed-by: jjg
  • Loading branch information
jlahoda committed Jun 19, 2017
1 parent 71b956f commit d1e21b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ public class Modules extends JCTree.Visitor {

public final boolean multiModuleMode;

private final String legacyModuleOverride;

private final Name java_se;
private final Name java_;

Expand Down Expand Up @@ -196,14 +194,6 @@ protected Modules(Context context) {
allowAccessIntoSystem = options.isUnset(Option.RELEASE);
lintOptions = options.isUnset(Option.XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option);

Collection<String> xmodules = options.keySet()
.stream()
.filter(opt -> opt.startsWith(XMODULES_PREFIX))
.map(opt -> opt.substring(XMODULES_PREFIX.length()))
.collect(Collectors.toList());

legacyModuleOverride = xmodules.size() == 1 ? xmodules.iterator().next() : null;

multiModuleMode = fileManager.hasLocation(StandardLocation.MODULE_SOURCE_PATH);
ClassWriter classWriter = ClassWriter.instance(context);
classWriter.multiModuleMode = multiModuleMode;
Expand Down Expand Up @@ -469,9 +459,6 @@ private void setCompilationUnitModules(List<JCCompilationUnit> trees, Set<Module
if (moduleOverride != null) {
checkNoAllModulePath();
defaultModule = moduleFinder.findModule(names.fromString(moduleOverride));
if (legacyModuleOverride != null) {
defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
}
defaultModule.patchOutputLocation = StandardLocation.CLASS_OUTPUT;
} else {
// Question: why not do findAllModules and initVisiblePackages here?
Expand Down Expand Up @@ -546,11 +533,6 @@ private void setCompilationUnitModules(List<JCCompilationUnit> trees, Set<Module
}

private void checkSourceLocation(JCCompilationUnit tree, ModuleSymbol msym) {
// skip check if legacy module override still in use
if (legacyModuleOverride != null) {
return;
}

try {
JavaFileObject fo = tree.sourcefile;
if (fileManager.contains(msym.sourceLocation, fo)) {
Expand Down Expand Up @@ -582,7 +564,7 @@ private void checkSourceLocation(JCCompilationUnit tree, ModuleSymbol msym) {

private String singleModuleOverride(List<JCCompilationUnit> trees) {
if (!fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH)) {
return legacyModuleOverride;
return null;
}

Set<String> override = new LinkedHashSet<>();
Expand All @@ -602,7 +584,7 @@ private String singleModuleOverride(List<JCCompilationUnit> trees) {
}

switch (override.size()) {
case 0: return legacyModuleOverride;
case 0: return null;
case 1: return override.iterator().next();
default:
log.error(Errors.TooManyPatchedModules(override));
Expand Down
85 changes: 0 additions & 85 deletions test/tools/javac/modules/LegacyXModuleTest.java

This file was deleted.

0 comments on commit d1e21b1

Please sign in to comment.