mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8169074: Build is failing after JDK-8166538
Reverting d7c9720c4223 Reviewed-by: darcy
This commit is contained in:
parent
5daafbe43b
commit
7cffceb22f
71 changed files with 114 additions and 1926 deletions
|
@ -914,7 +914,6 @@ public abstract class Symbol extends AnnoConstruct implements Element {
|
||||||
|
|
||||||
public PackageSymbol unnamedPackage;
|
public PackageSymbol unnamedPackage;
|
||||||
public Map<Name, PackageSymbol> visiblePackages;
|
public Map<Name, PackageSymbol> visiblePackages;
|
||||||
public Set<ModuleSymbol> readModules;
|
|
||||||
public List<Symbol> enclosedPackages = List.nil();
|
public List<Symbol> enclosedPackages = List.nil();
|
||||||
|
|
||||||
public Completer usesProvidesCompleter = Completer.NULL_COMPLETER;
|
public Completer usesProvidesCompleter = Completer.NULL_COMPLETER;
|
||||||
|
|
|
@ -353,7 +353,7 @@ public class Attr extends JCTree.Visitor {
|
||||||
@Override @DefinedBy(Api.COMPILER_TREE)
|
@Override @DefinedBy(Api.COMPILER_TREE)
|
||||||
public Symbol visitMemberSelect(MemberSelectTree node, Env<AttrContext> env) {
|
public Symbol visitMemberSelect(MemberSelectTree node, Env<AttrContext> env) {
|
||||||
Symbol site = visit(node.getExpression(), env);
|
Symbol site = visit(node.getExpression(), env);
|
||||||
if (site.kind == ERR || site.kind == ABSENT_TYP || site.kind == HIDDEN)
|
if (site.kind == ERR || site.kind == ABSENT_TYP)
|
||||||
return site;
|
return site;
|
||||||
Name name = (Name)node.getIdentifier();
|
Name name = (Name)node.getIdentifier();
|
||||||
if (site.kind == PCK) {
|
if (site.kind == PCK) {
|
||||||
|
|
|
@ -1132,7 +1132,6 @@ public class Modules extends JCTree.Visitor {
|
||||||
initAddExports();
|
initAddExports();
|
||||||
|
|
||||||
msym.visiblePackages = new LinkedHashMap<>();
|
msym.visiblePackages = new LinkedHashMap<>();
|
||||||
msym.readModules = new HashSet<>(readable);
|
|
||||||
|
|
||||||
Map<Name, ModuleSymbol> seen = new HashMap<>();
|
Map<Name, ModuleSymbol> seen = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
@ -54,19 +54,14 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticType;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.BiFunction;
|
|
||||||
import java.util.function.BiPredicate;
|
import java.util.function.BiPredicate;
|
||||||
import java.util.function.Predicate;
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import javax.lang.model.element.ElementVisitor;
|
import javax.lang.model.element.ElementVisitor;
|
||||||
|
|
||||||
import com.sun.tools.javac.code.Directive.ExportsDirective;
|
|
||||||
import static com.sun.tools.javac.code.Flags.*;
|
import static com.sun.tools.javac.code.Flags.*;
|
||||||
import static com.sun.tools.javac.code.Flags.BLOCK;
|
import static com.sun.tools.javac.code.Flags.BLOCK;
|
||||||
import static com.sun.tools.javac.code.Flags.STATIC;
|
import static com.sun.tools.javac.code.Flags.STATIC;
|
||||||
|
@ -74,8 +69,6 @@ import static com.sun.tools.javac.code.Kinds.*;
|
||||||
import static com.sun.tools.javac.code.Kinds.Kind.*;
|
import static com.sun.tools.javac.code.Kinds.Kind.*;
|
||||||
import static com.sun.tools.javac.code.TypeTag.*;
|
import static com.sun.tools.javac.code.TypeTag.*;
|
||||||
import static com.sun.tools.javac.comp.Resolve.MethodResolutionPhase.*;
|
import static com.sun.tools.javac.comp.Resolve.MethodResolutionPhase.*;
|
||||||
import com.sun.tools.javac.resources.CompilerProperties.Errors;
|
|
||||||
import com.sun.tools.javac.resources.CompilerProperties.Fragments;
|
|
||||||
import static com.sun.tools.javac.tree.JCTree.Tag.*;
|
import static com.sun.tools.javac.tree.JCTree.Tag.*;
|
||||||
|
|
||||||
/** Helper class for name resolution, used mostly by the attribution phase.
|
/** Helper class for name resolution, used mostly by the attribution phase.
|
||||||
|
@ -96,7 +89,6 @@ public class Resolve {
|
||||||
Check chk;
|
Check chk;
|
||||||
Infer infer;
|
Infer infer;
|
||||||
ClassFinder finder;
|
ClassFinder finder;
|
||||||
ModuleFinder moduleFinder;
|
|
||||||
Types types;
|
Types types;
|
||||||
JCDiagnostic.Factory diags;
|
JCDiagnostic.Factory diags;
|
||||||
public final boolean allowMethodHandles;
|
public final boolean allowMethodHandles;
|
||||||
|
@ -126,7 +118,6 @@ public class Resolve {
|
||||||
chk = Check.instance(context);
|
chk = Check.instance(context);
|
||||||
infer = Infer.instance(context);
|
infer = Infer.instance(context);
|
||||||
finder = ClassFinder.instance(context);
|
finder = ClassFinder.instance(context);
|
||||||
moduleFinder = ModuleFinder.instance(context);
|
|
||||||
types = Types.instance(context);
|
types = Types.instance(context);
|
||||||
diags = JCDiagnostic.Factory.instance(context);
|
diags = JCDiagnostic.Factory.instance(context);
|
||||||
Source source = Source.instance(context);
|
Source source = Source.instance(context);
|
||||||
|
@ -330,6 +321,7 @@ public class Resolve {
|
||||||
isAccessible = true;
|
isAccessible = true;
|
||||||
break;
|
break;
|
||||||
case PUBLIC:
|
case PUBLIC:
|
||||||
|
isAccessible = true;
|
||||||
if (allowModules && checkModuleAccess) {
|
if (allowModules && checkModuleAccess) {
|
||||||
ModuleSymbol currModule = env.toplevel.modle;
|
ModuleSymbol currModule = env.toplevel.modle;
|
||||||
currModule.complete();
|
currModule.complete();
|
||||||
|
@ -505,7 +497,7 @@ public class Resolve {
|
||||||
public Void visitClassType(ClassType t, Env<AttrContext> env) {
|
public Void visitClassType(ClassType t, Env<AttrContext> env) {
|
||||||
visit(t.getTypeArguments(), env);
|
visit(t.getTypeArguments(), env);
|
||||||
if (!isAccessible(env, t, true)) {
|
if (!isAccessible(env, t, true)) {
|
||||||
accessBase(new AccessError(env, null, t.tsym), env.tree.pos(), env.enclClass.sym, t, t.tsym.name, true);
|
accessBase(new AccessError(t.tsym), env.tree.pos(), env.enclClass.sym, t, t.tsym.name, true);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1986,109 +1978,26 @@ public class Resolve {
|
||||||
Symbol loadClass(Env<AttrContext> env, Name name) {
|
Symbol loadClass(Env<AttrContext> env, Name name) {
|
||||||
try {
|
try {
|
||||||
ClassSymbol c = finder.loadClass(env.toplevel.modle, name);
|
ClassSymbol c = finder.loadClass(env.toplevel.modle, name);
|
||||||
return isAccessible(env, c) ? c : new AccessError(env, null, c);
|
return isAccessible(env, c) ? c : new AccessError(c);
|
||||||
} catch (ClassFinder.BadClassFile err) {
|
} catch (ClassFinder.BadClassFile err) {
|
||||||
throw err;
|
throw err;
|
||||||
} catch (CompletionFailure ex) {
|
} catch (CompletionFailure ex) {
|
||||||
if (allowModules) {
|
//even if a class cannot be found in the current module and packages in modules it depends on that
|
||||||
Scope importScope = env.toplevel.namedImportScope;
|
//are exported for any or this module, the class may exist internally in some of these modules,
|
||||||
Symbol existing = importScope.findFirst(Convert.shortName(name),
|
//or may exist in a module on which this module does not depend. Provide better diagnostic in
|
||||||
sym -> sym.kind == TYP && sym.flatName() == name);
|
//such cases by looking for the class in any module:
|
||||||
|
for (ModuleSymbol ms : syms.getAllModules()) {
|
||||||
|
//do not load currently unloaded classes, to avoid too eager completion of random things in other modules:
|
||||||
|
ClassSymbol clazz = syms.getClass(ms, name);
|
||||||
|
|
||||||
if (existing != null) {
|
if (clazz != null) {
|
||||||
return new InvisibleSymbolError(env, true, existing);
|
return new AccessError(clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
return lookupInvisibleSymbol(env, name, syms::getClass, (ms, n) -> {
|
|
||||||
try {
|
|
||||||
return finder.loadClass(ms, n);
|
|
||||||
} catch (CompletionFailure cf) {
|
|
||||||
//ignore
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, sym -> sym.kind == Kind.TYP, false, typeNotFound);
|
|
||||||
}
|
}
|
||||||
return typeNotFound;
|
return typeNotFound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol lookupPackage(Env<AttrContext> env, Name name) {
|
|
||||||
PackageSymbol pack = syms.lookupPackage(env.toplevel.modle, name);
|
|
||||||
|
|
||||||
pack.complete();
|
|
||||||
|
|
||||||
if (!pack.exists() && allowModules && isImportOnDemand(env, name)) {
|
|
||||||
Name nameAndDot = name.append('.', names.empty);
|
|
||||||
boolean prefixOfKnown =
|
|
||||||
env.toplevel.modle.visiblePackages.values()
|
|
||||||
.stream()
|
|
||||||
.anyMatch(p -> p.fullname.startsWith(nameAndDot));
|
|
||||||
|
|
||||||
return lookupInvisibleSymbol(env, name, syms::getPackage, syms::enterPackage, sym -> {
|
|
||||||
sym.complete();
|
|
||||||
return sym.exists();
|
|
||||||
}, prefixOfKnown, pack);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pack;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isImportOnDemand(Env<AttrContext> env, Name name) {
|
|
||||||
if (!env.tree.hasTag(IMPORT))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
JCTree qualid = ((JCImport) env.tree).qualid;
|
|
||||||
|
|
||||||
if (!qualid.hasTag(SELECT))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (TreeInfo.name(qualid) != names.asterisk)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return TreeInfo.fullName(((JCFieldAccess) qualid).selected) == name;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Symbol lookupInvisibleSymbol(Env<AttrContext> env,
|
|
||||||
Name name,
|
|
||||||
BiFunction<ModuleSymbol, Name, Symbol> get,
|
|
||||||
BiFunction<ModuleSymbol, Name, Symbol> load,
|
|
||||||
Predicate<Symbol> validate,
|
|
||||||
boolean suppressError,
|
|
||||||
Symbol defaultResult) {
|
|
||||||
//even if a class/package cannot be found in the current module and among packages in modules
|
|
||||||
//it depends on that are exported for any or this module, the class/package may exist internally
|
|
||||||
//in some of these modules, or may exist in a module on which this module does not depend.
|
|
||||||
//Provide better diagnostic in such cases by looking for the class in any module:
|
|
||||||
Set<ModuleSymbol> recoverableModules = new HashSet<>(syms.getAllModules());
|
|
||||||
|
|
||||||
recoverableModules.remove(env.toplevel.modle);
|
|
||||||
|
|
||||||
for (ModuleSymbol ms : recoverableModules) {
|
|
||||||
Symbol sym = get.apply(ms, name);
|
|
||||||
|
|
||||||
//avoid overly eager completing classes from source-based modules, as those
|
|
||||||
//may not be completable with the current compiler settings:
|
|
||||||
if (sym == null && (ms.sourceLocation == null)) {
|
|
||||||
if (ms.classLocation == null) {
|
|
||||||
ms = moduleFinder.findModule(ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ms.kind != ERR) {
|
|
||||||
sym = load.apply(ms, name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sym == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (validate.test(sym)) {
|
|
||||||
return new InvisibleSymbolError(env, suppressError, sym);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return defaultResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a type declared in a scope (not inherited). Return null
|
* Find a type declared in a scope (not inherited). Return null
|
||||||
* if none is found.
|
* if none is found.
|
||||||
|
@ -2289,7 +2198,7 @@ public class Resolve {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kind.contains(KindSelector.PCK))
|
if (kind.contains(KindSelector.PCK))
|
||||||
return lookupPackage(env, name);
|
return syms.lookupPackage(env.toplevel.modle, name);
|
||||||
else return bestSoFar;
|
else return bestSoFar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2303,9 +2212,9 @@ public class Resolve {
|
||||||
Name name, KindSelector kind) {
|
Name name, KindSelector kind) {
|
||||||
Name fullname = TypeSymbol.formFullName(name, pck);
|
Name fullname = TypeSymbol.formFullName(name, pck);
|
||||||
Symbol bestSoFar = typeNotFound;
|
Symbol bestSoFar = typeNotFound;
|
||||||
Symbol pack = null;
|
PackageSymbol pack = null;
|
||||||
if (kind.contains(KindSelector.PCK)) {
|
if (kind.contains(KindSelector.PCK)) {
|
||||||
pack = lookupPackage(env, fullname);
|
pack = syms.lookupPackage(env.toplevel.modle, fullname);
|
||||||
if (pack.exists()) return pack;
|
if (pack.exists()) return pack;
|
||||||
}
|
}
|
||||||
if (kind.contains(KindSelector.TYP)) {
|
if (kind.contains(KindSelector.TYP)) {
|
||||||
|
@ -4025,6 +3934,10 @@ public class Resolve {
|
||||||
private Env<AttrContext> env;
|
private Env<AttrContext> env;
|
||||||
private Type site;
|
private Type site;
|
||||||
|
|
||||||
|
AccessError(Symbol sym) {
|
||||||
|
this(null, null, sym);
|
||||||
|
}
|
||||||
|
|
||||||
AccessError(Env<AttrContext> env, Type site, Symbol sym) {
|
AccessError(Env<AttrContext> env, Type site, Symbol sym) {
|
||||||
super(HIDDEN, sym, "access error");
|
super(HIDDEN, sym, "access error");
|
||||||
this.env = env;
|
this.env = env;
|
||||||
|
@ -4057,14 +3970,7 @@ public class Resolve {
|
||||||
if (sym.owner.kind == PCK) {
|
if (sym.owner.kind == PCK) {
|
||||||
return diags.create(dkind, log.currentSource(),
|
return diags.create(dkind, log.currentSource(),
|
||||||
pos, "not.def.access.package.cant.access",
|
pos, "not.def.access.package.cant.access",
|
||||||
sym, sym.location(), inaccessiblePackageReason(env, sym.packge()));
|
sym, sym.location());
|
||||||
} else if ( sym.packge() != syms.rootPackage
|
|
||||||
&& sym.packge().modle != env.toplevel.modle
|
|
||||||
&& !isAccessible(env, sym.outermostClass())) {
|
|
||||||
return diags.create(dkind, log.currentSource(),
|
|
||||||
pos, "not.def.access.class.intf.cant.access.reason",
|
|
||||||
sym, sym.location(), sym.location().packge(),
|
|
||||||
inaccessiblePackageReason(env, sym.packge()));
|
|
||||||
} else {
|
} else {
|
||||||
return diags.create(dkind, log.currentSource(),
|
return diags.create(dkind, log.currentSource(),
|
||||||
pos, "not.def.access.class.intf.cant.access",
|
pos, "not.def.access.class.intf.cant.access",
|
||||||
|
@ -4096,90 +4002,6 @@ public class Resolve {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InvisibleSymbolError extends InvalidSymbolError {
|
|
||||||
|
|
||||||
private final Env<AttrContext> env;
|
|
||||||
private final boolean suppressError;
|
|
||||||
|
|
||||||
InvisibleSymbolError(Env<AttrContext> env, boolean suppressError, Symbol sym) {
|
|
||||||
super(HIDDEN, sym, "invisible class error");
|
|
||||||
this.env = env;
|
|
||||||
this.suppressError = suppressError;
|
|
||||||
this.name = sym.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
JCDiagnostic getDiagnostic(JCDiagnostic.DiagnosticType dkind,
|
|
||||||
DiagnosticPosition pos,
|
|
||||||
Symbol location,
|
|
||||||
Type site,
|
|
||||||
Name name,
|
|
||||||
List<Type> argtypes,
|
|
||||||
List<Type> typeargtypes) {
|
|
||||||
if (suppressError)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (sym.kind == PCK) {
|
|
||||||
JCDiagnostic details = inaccessiblePackageReason(env, sym.packge());
|
|
||||||
return diags.create(dkind, log.currentSource(),
|
|
||||||
pos, "package.not.visible", sym, details);
|
|
||||||
}
|
|
||||||
|
|
||||||
JCDiagnostic details = inaccessiblePackageReason(env, sym.packge());
|
|
||||||
|
|
||||||
if (pos.getTree() != null && pos.getTree().hasTag(SELECT) && sym.owner.kind == PCK) {
|
|
||||||
pos = ((JCFieldAccess) pos.getTree()).selected.pos();
|
|
||||||
|
|
||||||
return diags.create(dkind, log.currentSource(),
|
|
||||||
pos, "package.not.visible", sym.packge(), details);
|
|
||||||
}
|
|
||||||
|
|
||||||
return diags.create(dkind, log.currentSource(),
|
|
||||||
pos, "not.def.access.package.cant.access", sym, sym.packge(), details);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JCDiagnostic inaccessiblePackageReason(Env<AttrContext> env, PackageSymbol sym) {
|
|
||||||
//no dependency:
|
|
||||||
if (!env.toplevel.modle.readModules.contains(sym.modle)) {
|
|
||||||
//does not read:
|
|
||||||
if (sym.modle != syms.unnamedModule) {
|
|
||||||
if (env.toplevel.modle != syms.unnamedModule) {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessDoesNotRead(env.toplevel.modle,
|
|
||||||
sym,
|
|
||||||
sym.modle));
|
|
||||||
} else {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessDoesNotReadFromUnnamed(sym,
|
|
||||||
sym.modle));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessDoesNotReadUnnamed(sym,
|
|
||||||
env.toplevel.modle));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (sym.packge().modle.exports.stream().anyMatch(e -> e.packge == sym)) {
|
|
||||||
//not exported to this module:
|
|
||||||
if (env.toplevel.modle != syms.unnamedModule) {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessNotExportedToModule(sym,
|
|
||||||
sym.modle,
|
|
||||||
env.toplevel.modle));
|
|
||||||
} else {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessNotExportedToModuleFromUnnamed(sym,
|
|
||||||
sym.modle));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//not exported:
|
|
||||||
if (env.toplevel.modle != syms.unnamedModule) {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessNotExported(sym,
|
|
||||||
sym.modle));
|
|
||||||
} else {
|
|
||||||
return diags.fragment(Fragments.NotDefAccessNotExportedFromUnnamed(sym,
|
|
||||||
sym.modle));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* InvalidSymbolError error class indicating that an instance member
|
* InvalidSymbolError error class indicating that an instance member
|
||||||
* has erroneously been accessed from a static context.
|
* has erroneously been accessed from a static context.
|
||||||
|
|
|
@ -403,7 +403,7 @@ public class TypeEnter implements Completer {
|
||||||
importNamedStatic(tree, p, name, localEnv);
|
importNamedStatic(tree, p, name, localEnv);
|
||||||
chk.checkCanonical(imp.selected);
|
chk.checkCanonical(imp.selected);
|
||||||
} else {
|
} else {
|
||||||
TypeSymbol c = attribImportType(imp, localEnv).getOriginalType().tsym;
|
TypeSymbol c = attribImportType(imp, localEnv).tsym;
|
||||||
chk.checkCanonical(imp);
|
chk.checkCanonical(imp);
|
||||||
importNamed(tree.pos(), c, env, tree);
|
importNamed(tree.pos(), c, env, tree);
|
||||||
}
|
}
|
||||||
|
|
|
@ -823,87 +823,17 @@ compiler.err.no.match.entry=\
|
||||||
compiler.err.not.annotation.type=\
|
compiler.err.not.annotation.type=\
|
||||||
{0} is not an annotation type
|
{0} is not an annotation type
|
||||||
|
|
||||||
# 0: symbol, 1: symbol, 2: message segment
|
# 0: symbol, 1: symbol
|
||||||
compiler.err.not.def.access.package.cant.access=\
|
compiler.err.not.def.access.package.cant.access=\
|
||||||
{0} is not visible\n\
|
{0} is not visible because package {1} is not visible
|
||||||
({2})
|
|
||||||
|
|
||||||
# 0: symbol, 1: symbol, 2: message segment
|
|
||||||
compiler.misc.not.def.access.package.cant.access=\
|
|
||||||
{0} is not visible\n\
|
|
||||||
({2})
|
|
||||||
|
|
||||||
# 0: symbol, 1: message segment
|
|
||||||
compiler.err.package.not.visible=\
|
|
||||||
package {0} is not visible\n\
|
|
||||||
({1})
|
|
||||||
|
|
||||||
# 0: symbol, 1: message segment
|
|
||||||
compiler.misc.package.not.visible=\
|
|
||||||
package {0} is not visible\n\
|
|
||||||
({1})
|
|
||||||
|
|
||||||
# {0} - current module
|
|
||||||
# {1} - package in which the invisible class is declared
|
|
||||||
# {2} - module in which {1} is declared
|
|
||||||
# 0: symbol, 1: symbol, 2: symbol
|
|
||||||
compiler.misc.not.def.access.does.not.read=\
|
|
||||||
package {1} is declared in module {2}, but module {0} does not read it
|
|
||||||
|
|
||||||
# {0} - package in which the invisible class is declared
|
|
||||||
# {1} - module in which {0} is declared
|
|
||||||
# 0: symbol, 1: symbol
|
|
||||||
compiler.misc.not.def.access.does.not.read.from.unnamed=\
|
|
||||||
package {0} is declared in module {1}, which is not in the module graph
|
|
||||||
|
|
||||||
# {0} - package in which the invisible class is declared
|
|
||||||
# {1} - current module
|
|
||||||
# 0: symbol, 1: symbol
|
|
||||||
compiler.misc.not.def.access.does.not.read.unnamed=\
|
|
||||||
package {0} is declared in the unnamed module, but module {0} does not read it
|
|
||||||
|
|
||||||
# {0} - package in which the invisible class is declared
|
|
||||||
# {1} - module in which {0} is declared
|
|
||||||
# 0: symbol, 1: symbol
|
|
||||||
compiler.misc.not.def.access.not.exported=\
|
|
||||||
package {0} is declared in module {1}, which does not export it
|
|
||||||
|
|
||||||
# {0} - package in which the invisible class is declared
|
|
||||||
# {1} - module in which {0} is declared
|
|
||||||
# 0: symbol, 1: symbol
|
|
||||||
compiler.misc.not.def.access.not.exported.from.unnamed=\
|
|
||||||
package {0} is declared in module {1}, which does not export it
|
|
||||||
|
|
||||||
# {0} - package in which the invisible class is declared
|
|
||||||
# {1} - module in which {0} is declared
|
|
||||||
# {2} - current module
|
|
||||||
# 0: symbol, 1: symbol, 2: symbol
|
|
||||||
compiler.misc.not.def.access.not.exported.to.module=\
|
|
||||||
package {0} is declared in module {1}, which does not export it to module {2}
|
|
||||||
|
|
||||||
# {0} - package in which the invisible class is declared
|
|
||||||
# {1} - module in which {0} is declared
|
|
||||||
# 0: symbol, 1: symbol
|
|
||||||
compiler.misc.not.def.access.not.exported.to.module.from.unnamed=\
|
|
||||||
package {0} is declared in module {1}, which does not export it to the unnamed module
|
|
||||||
|
|
||||||
# 0: symbol, 1: symbol
|
# 0: symbol, 1: symbol
|
||||||
compiler.err.not.def.access.class.intf.cant.access=\
|
compiler.err.not.def.access.class.intf.cant.access=\
|
||||||
{1}.{0} is defined in an inaccessible class or interface
|
{0} in {1} is defined in an inaccessible class or interface
|
||||||
|
|
||||||
# 0: symbol, 1: symbol
|
# 0: symbol, 1: symbol
|
||||||
compiler.misc.not.def.access.class.intf.cant.access=\
|
compiler.misc.not.def.access.class.intf.cant.access=\
|
||||||
{1}.{0} is defined in an inaccessible class or interface
|
{0} in {1} is defined in an inaccessible class or interface
|
||||||
|
|
||||||
# 0: symbol, 1: symbol, 2: symbol, 3: message segment
|
|
||||||
compiler.err.not.def.access.class.intf.cant.access.reason=\
|
|
||||||
{1}.{0} in package {2} is not accessible\n\
|
|
||||||
({3})
|
|
||||||
|
|
||||||
# 0: symbol, 1: symbol, 2: symbol, 3: message segment
|
|
||||||
compiler.misc.not.def.access.class.intf.cant.access.reason=\
|
|
||||||
{1}.{0} in package {2} is not accessible\n\
|
|
||||||
({3})
|
|
||||||
|
|
||||||
# 0: symbol, 1: list of type, 2: type
|
# 0: symbol, 1: list of type, 2: type
|
||||||
compiler.misc.cant.access.inner.cls.constr=\
|
compiler.misc.cant.access.inner.cls.constr=\
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
util.java:15:1: compiler.err.clash.with.pkg.of.same.name: kindname.class, java.util
|
util.java:13:17: compiler.err.cant.resolve.location: kindname.class, Set, , , (compiler.misc.location: kindname.class, java.util, null)
|
||||||
1 error
|
util.java:16:5: compiler.err.cant.resolve.location: kindname.class, Set, , , (compiler.misc.location: kindname.class, java.util, null)
|
||||||
|
2 errors
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* @bug 5003235
|
* @bug 5003235
|
||||||
* @summary Private inner class accessible from subclasses
|
* @summary Private inner class accessible from subclasses
|
||||||
* @author Peter von der Ah\u00e9
|
* @author Peter von der Ah\u00e9
|
||||||
* @compile/fail/ref=T5003235a.out -XDrawDiagnostics T5003235a.java
|
* @compile/fail/ref=T5003235a.out --diags:layout=%b:%l:%_%m T5003235a.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Super {
|
class Super {
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
T5003235a.java:21:10: compiler.err.not.def.access.class.intf.cant.access: defaultM(), Super.Inner
|
T5003235a.java:21: defaultM() in Super.Inner is defined in an inaccessible class or interface
|
||||||
T5003235a.java:22:10: compiler.err.not.def.access.class.intf.cant.access: protectedM(), Super.Inner
|
i.defaultM();
|
||||||
T5003235a.java:23:10: compiler.err.not.def.access.class.intf.cant.access: publicM(), Super.Inner
|
^
|
||||||
T5003235a.java:24:10: compiler.err.not.def.access.class.intf.cant.access: privateM(), Super.Inner
|
T5003235a.java:22: protectedM() in Super.Inner is defined in an inaccessible class or interface
|
||||||
|
i.protectedM();
|
||||||
|
^
|
||||||
|
T5003235a.java:23: publicM() in Super.Inner is defined in an inaccessible class or interface
|
||||||
|
i.publicM();
|
||||||
|
^
|
||||||
|
T5003235a.java:24: privateM() in Super.Inner is defined in an inaccessible class or interface
|
||||||
|
i.privateM();
|
||||||
|
^
|
||||||
4 errors
|
4 errors
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* @bug 5003235
|
* @bug 5003235
|
||||||
* @summary Accessibility of private inner class
|
* @summary Accessibility of private inner class
|
||||||
* @author Peter von der Ah\u00e9
|
* @author Peter von der Ah\u00e9
|
||||||
* @compile/fail/ref=T5003235b.out -XDrawDiagnostics T5003235b.java
|
* @compile/fail/ref=T5003235b.out --diags:layout=%b:%l:%_%m T5003235b.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Outer {
|
class Outer {
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
T5003235b.java:28:56: compiler.err.not.def.access.class.intf.cant.access: k, Outer.Inner
|
T5003235b.java:28: k in Outer.Inner is defined in an inaccessible class or interface
|
||||||
T5003235b.java:29:56: compiler.err.not.def.access.class.intf.cant.access: l, Outer.Inner
|
System.out.println("Value of k: " + outer.inner.k);
|
||||||
T5003235b.java:30:56: compiler.err.not.def.access.class.intf.cant.access: m, Outer.Inner
|
^
|
||||||
T5003235b.java:31:56: compiler.err.not.def.access.class.intf.cant.access: n, Outer.Inner
|
T5003235b.java:29: l in Outer.Inner is defined in an inaccessible class or interface
|
||||||
|
System.out.println("Value of l: " + outer.inner.l);
|
||||||
|
^
|
||||||
|
T5003235b.java:30: m in Outer.Inner is defined in an inaccessible class or interface
|
||||||
|
System.out.println("Value of m: " + outer.inner.m);
|
||||||
|
^
|
||||||
|
T5003235b.java:31: n in Outer.Inner is defined in an inaccessible class or interface
|
||||||
|
System.out.println("Value of n: " + outer.inner.n);
|
||||||
|
^
|
||||||
4 errors
|
4 errors
|
||||||
|
|
|
@ -61,10 +61,9 @@ class Example implements Comparable<Example> {
|
||||||
declaredKeys = new TreeSet<String>();
|
declaredKeys = new TreeSet<String>();
|
||||||
srcFiles = new ArrayList<File>();
|
srcFiles = new ArrayList<File>();
|
||||||
procFiles = new ArrayList<File>();
|
procFiles = new ArrayList<File>();
|
||||||
|
supportFiles = new ArrayList<File>();
|
||||||
srcPathFiles = new ArrayList<File>();
|
srcPathFiles = new ArrayList<File>();
|
||||||
moduleSourcePathFiles = new ArrayList<File>();
|
moduleSourcePathFiles = new ArrayList<File>();
|
||||||
modulePathFiles = new ArrayList<File>();
|
|
||||||
classPathFiles = new ArrayList<File>();
|
|
||||||
additionalFiles = new ArrayList<File>();
|
additionalFiles = new ArrayList<File>();
|
||||||
|
|
||||||
findFiles(file, srcFiles);
|
findFiles(file, srcFiles);
|
||||||
|
@ -90,13 +89,10 @@ class Example implements Comparable<Example> {
|
||||||
} else if (files == srcFiles && c.getName().equals("additional")) {
|
} else if (files == srcFiles && c.getName().equals("additional")) {
|
||||||
additionalFilesDir = c;
|
additionalFilesDir = c;
|
||||||
findFiles(c, additionalFiles);
|
findFiles(c, additionalFiles);
|
||||||
} else if (files == srcFiles && c.getName().equals("modulepath")) {
|
} else if (files == srcFiles && c.getName().equals("support"))
|
||||||
findFiles(c, modulePathFiles);
|
findFiles(c, supportFiles);
|
||||||
} else if (files == srcFiles && c.getName().equals("classpath")) {
|
else
|
||||||
findFiles(c, classPathFiles);
|
|
||||||
} else {
|
|
||||||
findFiles(c, files);
|
findFiles(c, files);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (f.isFile()) {
|
} else if (f.isFile()) {
|
||||||
if (f.getName().endsWith(".java")) {
|
if (f.getName().endsWith(".java")) {
|
||||||
|
@ -198,32 +194,23 @@ class Example implements Comparable<Example> {
|
||||||
*/
|
*/
|
||||||
private void run(PrintWriter out, Set<String> keys, boolean raw, boolean verbose)
|
private void run(PrintWriter out, Set<String> keys, boolean raw, boolean verbose)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
List<String> opts = new ArrayList<String>();
|
ClassLoader loader = getClass().getClassLoader();
|
||||||
if (!modulePathFiles.isEmpty()) {
|
if (supportFiles.size() > 0) {
|
||||||
File modulepathDir = new File(tempDir, "modulepath");
|
File supportDir = new File(tempDir, "support");
|
||||||
modulepathDir.mkdirs();
|
supportDir.mkdirs();
|
||||||
clean(modulepathDir);
|
clean(supportDir);
|
||||||
List<String> sOpts = Arrays.asList("-d", modulepathDir.getPath(),
|
List<String> sOpts = Arrays.asList("-d", supportDir.getPath());
|
||||||
"--module-source-path", new File(file, "modulepath").getAbsolutePath());
|
new Jsr199Compiler(verbose).run(null, null, false, sOpts, procFiles);
|
||||||
new Jsr199Compiler(verbose).run(null, null, false, sOpts, modulePathFiles);
|
URLClassLoader ucl =
|
||||||
opts.add("--module-path");
|
new URLClassLoader(new URL[] { supportDir.toURI().toURL() }, loader);
|
||||||
opts.add(modulepathDir.getAbsolutePath());
|
loader = ucl;
|
||||||
}
|
|
||||||
|
|
||||||
if (!classPathFiles.isEmpty()) {
|
|
||||||
File classpathDir = new File(tempDir, "classpath");
|
|
||||||
classpathDir.mkdirs();
|
|
||||||
clean(classpathDir);
|
|
||||||
List<String> sOpts = Arrays.asList("-d", classpathDir.getPath());
|
|
||||||
new Jsr199Compiler(verbose).run(null, null, false, sOpts, classPathFiles);
|
|
||||||
opts.add("--class-path");
|
|
||||||
opts.add(classpathDir.getAbsolutePath());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
File classesDir = new File(tempDir, "classes");
|
File classesDir = new File(tempDir, "classes");
|
||||||
classesDir.mkdirs();
|
classesDir.mkdirs();
|
||||||
clean(classesDir);
|
clean(classesDir);
|
||||||
|
|
||||||
|
List<String> opts = new ArrayList<String>();
|
||||||
opts.add("-d");
|
opts.add("-d");
|
||||||
opts.add(classesDir.getPath());
|
opts.add(classesDir.getPath());
|
||||||
if (options != null)
|
if (options != null)
|
||||||
|
@ -340,9 +327,8 @@ class Example implements Comparable<Example> {
|
||||||
File additionalFilesDir;
|
File additionalFilesDir;
|
||||||
List<File> srcPathFiles;
|
List<File> srcPathFiles;
|
||||||
List<File> moduleSourcePathFiles;
|
List<File> moduleSourcePathFiles;
|
||||||
List<File> modulePathFiles;
|
|
||||||
List<File> classPathFiles;
|
|
||||||
List<File> additionalFiles;
|
List<File> additionalFiles;
|
||||||
|
List<File> supportFiles;
|
||||||
File infoFile;
|
File infoFile;
|
||||||
private List<String> runOpts;
|
private List<String> runOpts;
|
||||||
private List<String> options;
|
private List<String> options;
|
||||||
|
|
|
@ -239,10 +239,8 @@ public class RunExamples {
|
||||||
srcFiles.remove(e.infoFile);
|
srcFiles.remove(e.infoFile);
|
||||||
showFiles(e, srcFiles);
|
showFiles(e, srcFiles);
|
||||||
showFiles(e, e.srcPathFiles);
|
showFiles(e, e.srcPathFiles);
|
||||||
showFiles(e, e.moduleSourcePathFiles);
|
|
||||||
showFiles(e, e.modulePathFiles);
|
|
||||||
showFiles(e, e.classPathFiles);
|
|
||||||
showFiles(e, e.procFiles);
|
showFiles(e, e.procFiles);
|
||||||
|
showFiles(e, e.supportFiles);
|
||||||
}
|
}
|
||||||
run(e);
|
run(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ compiler.err.no.annotation.member
|
||||||
compiler.err.no.encl.instance.of.type.in.scope # cannot occur; always followed by assert false;
|
compiler.err.no.encl.instance.of.type.in.scope # cannot occur; always followed by assert false;
|
||||||
compiler.err.no.match.entry # UNUSED?
|
compiler.err.no.match.entry # UNUSED?
|
||||||
compiler.err.not.annotation.type # cannot occur given preceding checkType
|
compiler.err.not.annotation.type # cannot occur given preceding checkType
|
||||||
compiler.err.not.def.access.package.cant.access
|
|
||||||
compiler.err.proc.bad.config.file # JavacProcessingEnvironment
|
compiler.err.proc.bad.config.file # JavacProcessingEnvironment
|
||||||
compiler.err.proc.cant.access # completion failure
|
compiler.err.proc.cant.access # completion failure
|
||||||
compiler.err.proc.cant.access.1 # completion failure, no stack trace
|
compiler.err.proc.cant.access.1 # completion failure, no stack trace
|
||||||
|
@ -70,8 +69,6 @@ compiler.misc.incompatible.eq.lower.bounds # cannot happen?
|
||||||
compiler.misc.module.name.mismatch
|
compiler.misc.module.name.mismatch
|
||||||
compiler.misc.no.unique.minimal.instance.exists
|
compiler.misc.no.unique.minimal.instance.exists
|
||||||
compiler.misc.no.unique.maximal.instance.exists # cannot happen?
|
compiler.misc.no.unique.maximal.instance.exists # cannot happen?
|
||||||
compiler.misc.not.def.access.package.cant.access
|
|
||||||
compiler.misc.package.not.visible
|
|
||||||
compiler.misc.resume.abort # prompt for a response
|
compiler.misc.resume.abort # prompt for a response
|
||||||
compiler.misc.source.unavailable # DiagnosticSource
|
compiler.misc.source.unavailable # DiagnosticSource
|
||||||
compiler.misc.token.bad-symbol
|
compiler.misc.token.bad-symbol
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.not.def.access.class.intf.cant.access.reason
|
|
||||||
//key: compiler.misc.not.def.access.does.not.read
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api1;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
public static void test() {}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module api1 {
|
|
||||||
exports api1;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api2;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
public static api1.Api get() { return null; }
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package impl;
|
|
||||||
|
|
||||||
public class Impl {
|
|
||||||
void test() {
|
|
||||||
api2.Api.get().test();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module impl {
|
|
||||||
requires api2;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// key: compiler.err.prob.found.req
|
|
||||||
// key: compiler.misc.invalid.mref
|
|
||||||
// key: compiler.misc.not.def.access.class.intf.cant.access.reason
|
|
||||||
// key: compiler.misc.not.def.access.does.not.read
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api1;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
public static void test() {}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module api1 {
|
|
||||||
exports api1;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api2;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
public static api1.Api get() { return null; }
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module api2 {
|
|
||||||
requires api1;
|
|
||||||
exports api2;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package impl;
|
|
||||||
|
|
||||||
public class Impl {
|
|
||||||
void test(api2.Api a2) {
|
|
||||||
Runnable r = a2.get() :: test;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module impl {
|
|
||||||
requires api2;
|
|
||||||
}
|
|
|
@ -21,7 +21,4 @@
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module api2 {
|
// key: compiler.err.not.def.access.package.cant.access
|
||||||
requires api1;
|
|
||||||
exports api2;
|
|
||||||
}
|
|
|
@ -21,5 +21,4 @@
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module api {
|
module m1 {}
|
||||||
}
|
|
|
@ -21,6 +21,6 @@
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module api {
|
package p1;
|
||||||
exports api;
|
|
||||||
}
|
public class C1 {}
|
|
@ -21,5 +21,4 @@
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module api {
|
module m2 {}
|
||||||
}
|
|
|
@ -21,7 +21,8 @@
|
||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package api;
|
package p2;
|
||||||
|
|
||||||
public class Api {
|
public class C2 {
|
||||||
|
p1.C1 c1;
|
||||||
}
|
}
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.package.not.visible
|
|
||||||
//key: compiler.misc.not.def.access.does.not.read
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module api {
|
|
||||||
exports api;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package impl;
|
|
||||||
|
|
||||||
public class Impl {
|
|
||||||
api.Api api;
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module impl {
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.package.not.visible
|
|
||||||
//key: compiler.misc.not.def.access.does.not.read.from.unnamed
|
|
||||||
|
|
||||||
public class NotDefAccessDoesNotReadFromUnnamed {
|
|
||||||
api.Api api;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.not.def.access.class.intf.cant.access.reason
|
|
||||||
//key: compiler.misc.not.def.access.does.not.read.unnamed
|
|
||||||
//options: --add-reads=auxiliary=ALL-UNNAMED
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
public void test() {}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package auxiliary;
|
|
||||||
|
|
||||||
public class Auxiliary {
|
|
||||||
public static api.Api get() { return null; }
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module auxiliary {
|
|
||||||
exports auxiliary;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package impl;
|
|
||||||
|
|
||||||
public class Impl {
|
|
||||||
{
|
|
||||||
auxiliary.Auxiliary.get().test();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module impl {
|
|
||||||
requires auxiliary;
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.package.not.visible
|
|
||||||
//key: compiler.misc.not.def.access.not.exported
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package impl;
|
|
||||||
|
|
||||||
public class Impl {
|
|
||||||
api.Api api;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module impl {
|
|
||||||
requires api;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.package.not.visible
|
|
||||||
//key: compiler.misc.not.def.access.not.exported.from.unnamed
|
|
||||||
//options: --add-modules api
|
|
||||||
|
|
||||||
public class NotDefAccessNotExportedFromUnnamed {
|
|
||||||
api.Api api;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.package.not.visible
|
|
||||||
//key: compiler.misc.not.def.access.not.exported.to.module
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module api {
|
|
||||||
exports api to other;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package impl;
|
|
||||||
|
|
||||||
public class Impl {
|
|
||||||
api.Api api;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module impl {
|
|
||||||
requires api;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module other {
|
|
||||||
requires api;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//key: compiler.err.package.not.visible
|
|
||||||
//key: compiler.misc.not.def.access.not.exported.to.module.from.unnamed
|
|
||||||
//options: --add-modules api
|
|
||||||
|
|
||||||
public class NotDefAccessNotExportedToModuleFromUnnamed {
|
|
||||||
api.Api api;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package api;
|
|
||||||
|
|
||||||
public class Api {
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module api {
|
|
||||||
exports api to other;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module other {
|
|
||||||
requires api;
|
|
||||||
}
|
|
|
@ -216,8 +216,8 @@ public class AddLimitMods extends ModuleTestBase {
|
||||||
|
|
||||||
private static final List<Entry<String[], String>> variants = Arrays.asList(
|
private static final List<Entry<String[], String>> variants = Arrays.asList(
|
||||||
new SimpleEntry<String[], String>(new String[] {},
|
new SimpleEntry<String[], String>(new String[] {},
|
||||||
"Test.java:2:7: compiler.err.package.not.visible: javax.annotation, (compiler.misc.not.def.access.does.not.read.from.unnamed: javax.annotation, java.annotations.common)\n"
|
"Test.java:2:18: compiler.err.doesnt.exist: javax.annotation\n"
|
||||||
+ "Test.java:5:14: compiler.err.package.not.visible: javax.xml.bind, (compiler.misc.not.def.access.does.not.read.from.unnamed: javax.xml.bind, java.xml.bind)\n"
|
+ "Test.java:5:19: compiler.err.doesnt.exist: javax.xml.bind\n"
|
||||||
+ "2 errors\n"),
|
+ "2 errors\n"),
|
||||||
new SimpleEntry<String[], String>(new String[] {"--add-modules", "java.annotations.common,java.xml.bind"},
|
new SimpleEntry<String[], String>(new String[] {"--add-modules", "java.annotations.common,java.xml.bind"},
|
||||||
null),
|
null),
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class AddReadsTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("Test.java:1:41: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.does.not.read: m2, api, m1)"))
|
if (!log.contains("Test.java:1:44: compiler.err.not.def.access.package.cant.access: api.Api, api"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
|
|
||||||
//test add dependencies:
|
//test add dependencies:
|
||||||
|
|
|
@ -283,7 +283,7 @@ public class AutomaticModules extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
List<String> expected = Arrays.asList("Impl.java:1:59: compiler.err.package.not.visible: m2, (compiler.misc.not.def.access.does.not.read: m1, m2, m2)",
|
List<String> expected = Arrays.asList("Impl.java:1:61: compiler.err.not.def.access.package.cant.access: m2.M2, m2",
|
||||||
"1 error");
|
"1 error");
|
||||||
|
|
||||||
if (!expected.equals(log)) {
|
if (!expected.equals(log)) {
|
||||||
|
@ -300,8 +300,8 @@ public class AutomaticModules extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
expected = Arrays.asList("Impl.java:1:47: compiler.err.package.not.visible: apiB, (compiler.misc.not.def.access.does.not.read: m1, apiB, automaticB)",
|
expected = Arrays.asList("Impl.java:1:51: compiler.err.doesnt.exist: apiB",
|
||||||
"Impl.java:1:59: compiler.err.package.not.visible: m2, (compiler.misc.not.def.access.does.not.read: m1, m2, m2)",
|
"Impl.java:1:61: compiler.err.not.def.access.package.cant.access: m2.M2, m2",
|
||||||
"2 errors");
|
"2 errors");
|
||||||
|
|
||||||
if (!expected.equals(log)) {
|
if (!expected.equals(log)) {
|
||||||
|
|
|
@ -1,453 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @test
|
|
||||||
* @summary Check convenient errors are produced for inaccessible classes.
|
|
||||||
* @library /tools/lib
|
|
||||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
|
||||||
* jdk.compiler/com.sun.tools.javac.main
|
|
||||||
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask ModuleTestBase
|
|
||||||
* @run main ConvenientAccessErrorsTest
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import toolbox.JarTask;
|
|
||||||
import toolbox.JavacTask;
|
|
||||||
import toolbox.Task;
|
|
||||||
|
|
||||||
public class ConvenientAccessErrorsTest extends ModuleTestBase {
|
|
||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
|
||||||
new ConvenientAccessErrorsTest().runTests();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNoDep(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { exports api; }",
|
|
||||||
"package api; public class Api { public void call() { } }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { }",
|
|
||||||
"package test; public class Test { api.Api api; }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:35: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.does.not.read: m2, api, m1)",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNotExported(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { exports api; }",
|
|
||||||
"package api; public class Api { }",
|
|
||||||
"package impl; public class Impl { }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { requires m1; }",
|
|
||||||
"package test; public class Test { impl.Impl api; }");
|
|
||||||
Path src_m3 = src.resolve("m3");
|
|
||||||
tb.writeJavaFiles(src_m3,
|
|
||||||
"module m3 { requires m1; }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:35: compiler.err.package.not.visible: impl, (compiler.misc.not.def.access.not.exported: impl, m1)",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { exports api; exports impl to m3;}");
|
|
||||||
|
|
||||||
log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
expected = Arrays.asList(
|
|
||||||
"Test.java:1:35: compiler.err.package.not.visible: impl, (compiler.misc.not.def.access.not.exported.to.module: impl, m1, m2)",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testInaccessibleInExported(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { exports api; }",
|
|
||||||
"package api; class Api { }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { requires m1; }",
|
|
||||||
"package test; public class Test { api.Api api; }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:38: compiler.err.not.def.public.cant.access: api.Api, api",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testInaccessibleUnnamedModule(Path base) throws Exception {
|
|
||||||
Path jar = prepareTestJar(base, "package api; class Api { public static class Foo {} }");
|
|
||||||
|
|
||||||
Path moduleSrc = base.resolve("module-src");
|
|
||||||
Path m1 = moduleSrc.resolve("m1");
|
|
||||||
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
|
|
||||||
Files.createDirectories(classes);
|
|
||||||
|
|
||||||
tb.writeJavaFiles(m1,
|
|
||||||
"module m1 { }",
|
|
||||||
"package test; public class Test { api.Api api; api.Api.Foo api; }");
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-classpath", jar.toString(),
|
|
||||||
"-XDrawDiagnostics")
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(moduleSrc))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:38: compiler.err.not.def.access.package.cant.access: api.Api, api, (compiler.misc.not.def.access.does.not.read.unnamed: api, m1)",
|
|
||||||
"Test.java:1:51: compiler.err.not.def.access.package.cant.access: api.Api, api, (compiler.misc.not.def.access.does.not.read.unnamed: api, m1)",
|
|
||||||
"2 errors");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testIndirectReferenceToUnnamedModule(Path base) throws Exception {
|
|
||||||
Path jar = prepareTestJar(base, "package api; public class Api { public void test() {} }");
|
|
||||||
|
|
||||||
Path moduleSrc = base.resolve("module-src");
|
|
||||||
Path m1 = moduleSrc.resolve("m1");
|
|
||||||
Path auxiliary = moduleSrc.resolve("auxiliary");
|
|
||||||
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
|
|
||||||
Files.createDirectories(classes);
|
|
||||||
|
|
||||||
tb.writeJavaFiles(m1,
|
|
||||||
"module m1 { requires auxiliary; }",
|
|
||||||
"package test; public class Test { { auxiliary.Auxiliary.get().test(); } }");
|
|
||||||
|
|
||||||
tb.writeJavaFiles(auxiliary,
|
|
||||||
"module auxiliary { exports auxiliary; }",
|
|
||||||
"package auxiliary; public class Auxiliary { public static api.Api get() { return null; } }");
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-classpath", jar.toString(),
|
|
||||||
"-XDrawDiagnostics",
|
|
||||||
"--add-reads", "auxiliary=ALL-UNNAMED",
|
|
||||||
"--module-source-path", moduleSrc.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(moduleSrc))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:62: compiler.err.not.def.access.class.intf.cant.access.reason: test(), api.Api, api, (compiler.misc.not.def.access.does.not.read.unnamed: api, m1)",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Path prepareTestJar(Path base, String code) throws Exception {
|
|
||||||
Path legacySrc = base.resolve("legacy-src");
|
|
||||||
tb.writeJavaFiles(legacySrc, code);
|
|
||||||
Path legacyClasses = base.resolve("legacy-classes");
|
|
||||||
Files.createDirectories(legacyClasses);
|
|
||||||
|
|
||||||
String log = new JavacTask(tb)
|
|
||||||
.options()
|
|
||||||
.outdir(legacyClasses)
|
|
||||||
.files(findJavaFiles(legacySrc))
|
|
||||||
.run()
|
|
||||||
.writeAll()
|
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
if (!log.isEmpty()) {
|
|
||||||
throw new Exception("unexpected output: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
Path lib = base.resolve("lib");
|
|
||||||
|
|
||||||
Files.createDirectories(lib);
|
|
||||||
|
|
||||||
Path jar = lib.resolve("test-api-1.0.jar");
|
|
||||||
|
|
||||||
new JarTask(tb, jar)
|
|
||||||
.baseDir(legacyClasses)
|
|
||||||
.files("api/Api.class")
|
|
||||||
.run();
|
|
||||||
|
|
||||||
return jar;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUnnamedModuleAccess(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { exports api to m2; }",
|
|
||||||
"package api; class Api { }",
|
|
||||||
"package impl; class Impl { }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { requires m1; }");
|
|
||||||
Path modulepath = base.resolve("modulepath");
|
|
||||||
tb.createDirectories(modulepath);
|
|
||||||
|
|
||||||
new JavacTask(tb)
|
|
||||||
.options("--module-source-path", src.toString())
|
|
||||||
.outdir(modulepath)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run()
|
|
||||||
.writeAll();
|
|
||||||
|
|
||||||
Path unnamedSrc = base.resolve("unnamedSrc");
|
|
||||||
tb.writeJavaFiles(unnamedSrc,
|
|
||||||
"public class Test { api.Api api; impl.Impl impl; }");
|
|
||||||
Path unnamedClasses = base.resolve("unnamed-classes");
|
|
||||||
Files.createDirectories(unnamedClasses);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("--module-path", modulepath.toString(),
|
|
||||||
"-XDrawDiagnostics")
|
|
||||||
.outdir(unnamedClasses)
|
|
||||||
.files(findJavaFiles(unnamedSrc))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:21: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.does.not.read.from.unnamed: api, m1)",
|
|
||||||
"Test.java:1:34: compiler.err.package.not.visible: impl, (compiler.misc.not.def.access.does.not.read.from.unnamed: impl, m1)",
|
|
||||||
"2 errors"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!expected.equals(log)) {
|
|
||||||
throw new Exception("unexpected output: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
log = new JavacTask(tb)
|
|
||||||
.options("--module-path", modulepath.toString(),
|
|
||||||
"--add-modules", "m1",
|
|
||||||
"-XDrawDiagnostics")
|
|
||||||
.outdir(unnamedClasses)
|
|
||||||
.files(findJavaFiles(unnamedSrc))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
expected = Arrays.asList(
|
|
||||||
"Test.java:1:21: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.not.exported.to.module.from.unnamed: api, m1)",
|
|
||||||
"Test.java:1:34: compiler.err.package.not.visible: impl, (compiler.misc.not.def.access.not.exported.from.unnamed: impl, m1)",
|
|
||||||
"2 errors"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!expected.equals(log)) {
|
|
||||||
throw new Exception("unexpected output: " + log);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testInImport(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { }",
|
|
||||||
"package api; public class Api { public String test() { return null; } }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { requires m1; }",
|
|
||||||
"package test; import api.Api; public class Test { Api api; { api.test().length(); } }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:22: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.not.exported: api, m1)",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testInImportOnDemand(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { }",
|
|
||||||
"package api; public class Api { public String test() { return null; } }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { requires m1; }",
|
|
||||||
"package test; import api.*; public class Test { Api api; { api.test().length(); } }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:22: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.not.exported: api, m1)",
|
|
||||||
"Test.java:1:49: compiler.err.not.def.access.package.cant.access: api.Api, api, (compiler.misc.not.def.access.not.exported: api, m1)",
|
|
||||||
"2 errors");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUnusedImportOnDemand1(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
tb.writeJavaFiles(src,
|
|
||||||
"package test; import javax.annotation.*; public class Test { }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--add-modules", "java.compiler")
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run()
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList("");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUnusedImportOnDemand2(Path base) throws Exception {
|
|
||||||
Path src = base.resolve("src");
|
|
||||||
Path src_m1 = src.resolve("m1");
|
|
||||||
tb.writeJavaFiles(src_m1,
|
|
||||||
"module m1 { }",
|
|
||||||
"package api; public class Api { }");
|
|
||||||
Path src_m2 = src.resolve("m2");
|
|
||||||
tb.writeJavaFiles(src_m2,
|
|
||||||
"module m2 { requires m1; }",
|
|
||||||
"package test; import api.*; public class Test { }");
|
|
||||||
Path classes = base.resolve("classes");
|
|
||||||
tb.createDirectories(classes);
|
|
||||||
|
|
||||||
List<String> log = new JavacTask(tb)
|
|
||||||
.options("-XDrawDiagnostics",
|
|
||||||
"--module-source-path", src.toString())
|
|
||||||
.outdir(classes)
|
|
||||||
.files(findJavaFiles(src))
|
|
||||||
.run(Task.Expect.FAIL)
|
|
||||||
.writeAll()
|
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
|
||||||
"Test.java:1:22: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.not.exported: api, m1)",
|
|
||||||
"1 error");
|
|
||||||
|
|
||||||
if (!expected.equals(log))
|
|
||||||
throw new Exception("expected output not found; actual: " + log);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -177,7 +177,7 @@ public class EdgeCases extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("Test.java:1:52: compiler.err.not.def.access.class.intf.cant.access.reason: call(), api1.Api1, api1, (compiler.misc.not.def.access.does.not.read: m3, api1, m1)") ||
|
if (!log.contains("Test.java:1:52: compiler.err.not.def.access.class.intf.cant.access: call(), api1.Api1") ||
|
||||||
!log.contains("Test.java:1:76: compiler.err.not.def.access.class.intf.cant.access: toString(), java.lang.Object"))
|
!log.contains("Test.java:1:76: compiler.err.not.def.access.class.intf.cant.access: toString(), java.lang.Object"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,9 +134,9 @@ public class GraphsTest extends ModuleTestBase {
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
List<String> expected = Arrays.asList(
|
List<String> expected = Arrays.asList(
|
||||||
"Negative.java:1:36: compiler.err.package.not.visible: closedO, (compiler.misc.not.def.access.not.exported: closedO, O)",
|
"Negative.java:1:43: compiler.err.doesnt.exist: closedO",
|
||||||
"Negative.java:1:49: compiler.err.package.not.visible: closedN, (compiler.misc.not.def.access.not.exported: closedN, N)",
|
"Negative.java:1:56: compiler.err.doesnt.exist: closedN",
|
||||||
"Negative.java:1:62: compiler.err.package.not.visible: closedL, (compiler.misc.not.def.access.not.exported: closedL, L)");
|
"Negative.java:1:69: compiler.err.doesnt.exist: closedL");
|
||||||
if (!log.containsAll(expected)) {
|
if (!log.containsAll(expected)) {
|
||||||
throw new Exception("Expected output not found");
|
throw new Exception("Expected output not found");
|
||||||
}
|
}
|
||||||
|
@ -153,9 +153,9 @@ public class GraphsTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
expected = Arrays.asList(
|
expected = Arrays.asList(
|
||||||
"Negative.java:1:36: compiler.err.package.not.visible: closedO, (compiler.misc.not.def.access.not.exported: closedO, O)",
|
"Negative.java:1:43: compiler.err.not.def.access.package.cant.access: closedO.O, closedO",
|
||||||
"Negative.java:1:49: compiler.err.package.not.visible: closedN, (compiler.misc.not.def.access.not.exported: closedN, N)",
|
"Negative.java:1:56: compiler.err.not.def.access.package.cant.access: closedN.N, closedN",
|
||||||
"Negative.java:1:62: compiler.err.package.not.visible: closedL, (compiler.misc.not.def.access.not.exported: closedL, L)");
|
"Negative.java:1:69: compiler.err.not.def.access.package.cant.access: closedL.L, closedL");
|
||||||
if (!out.containsAll(expected)) {
|
if (!out.containsAll(expected)) {
|
||||||
throw new Exception("Expected output not found");
|
throw new Exception("Expected output not found");
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ public class GraphsTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
String expected = "A.java:1:31: compiler.err.package.not.visible: pack, (compiler.misc.not.def.access.not.exported.to.module: pack, N, L)";
|
String expected = "A.java:1:35: compiler.err.not.def.access.package.cant.access: pack.Clazz, pack";
|
||||||
if (!log.contains(expected)) {
|
if (!log.contains(expected)) {
|
||||||
throw new Exception("Expected output not found");
|
throw new Exception("Expected output not found");
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ public class PackageMultipleModules extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
List<String> expected = Arrays.asList("A.java:1:22: compiler.err.package.not.visible: test, (compiler.misc.not.def.access.does.not.read: m1, test, m2)",
|
List<String> expected = Arrays.asList("A.java:1:26: compiler.err.not.def.access.package.cant.access: test.B, test",
|
||||||
"B.java:1:22: compiler.err.package.not.visible: test, (compiler.misc.not.def.access.does.not.read: m2, test, m1)",
|
"B.java:1:26: compiler.err.not.def.access.package.cant.access: test.A, test",
|
||||||
"2 errors");
|
"2 errors");
|
||||||
if (!log.equals(expected))
|
if (!log.equals(expected))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class RequiresPublicTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("Test.java:1:22: compiler.err.package.not.visible: com.sun.source.tree, (compiler.misc.not.def.access.does.not.read: m, com.sun.source.tree, jdk.compiler)"))
|
if (!log.contains("Test.java:1:27: compiler.err.doesnt.exist: com.sun.source.tree"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,9 +121,15 @@ public class RequiresPublicTest extends ModuleTestBase {
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
String[] expect = {
|
String[] expect = {
|
||||||
"C1.java:5:8: compiler.err.package.not.visible: p5, (compiler.misc.not.def.access.does.not.read: m1, p5, m5)",
|
"C1.java:5:10: compiler.err.not.def.access.package.cant.access: p5.C5, p5",
|
||||||
"C1.java:5:22: compiler.err.package.not.visible: p6, (compiler.misc.not.def.access.does.not.read: m1, p6, m6)",
|
"C1.java:5:24: compiler.err.not.def.access.package.cant.access: p6.C6, p6",
|
||||||
"C1.java:5:36: compiler.err.package.not.visible: p7, (compiler.misc.not.def.access.does.not.read: m1, p7, m7)"
|
"C1.java:5:38: compiler.err.not.def.access.package.cant.access: p7.C7, p7",
|
||||||
|
"C1.java:8:1: compiler.err.cant.resolve.location: kindname.class, C5, , , "
|
||||||
|
+ "(compiler.misc.location: kindname.class, p1.C1, null)",
|
||||||
|
"C1.java:8:8: compiler.err.cant.resolve.location: kindname.class, C6, , , "
|
||||||
|
+ "(compiler.misc.location: kindname.class, p1.C1, null)",
|
||||||
|
"C1.java:8:15: compiler.err.cant.resolve.location: kindname.class, C7, , , "
|
||||||
|
+ "(compiler.misc.location: kindname.class, p1.C1, null)"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (String e: expect) {
|
for (String e: expect) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class ResolveTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("C2.java:1:31: compiler.err.package.not.visible: p1, (compiler.misc.not.def.access.does.not.read: m2, p1, m1)"))
|
if (!log.contains("C2.java:1:33: compiler.err.not.def.access.package.cant.access: p1.C1, p1"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class ResolveTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("C2.java:1:31: compiler.err.package.not.visible: p1, (compiler.misc.not.def.access.not.exported: p1, m1)"))
|
if (!log.contains("C2.java:1:33: compiler.err.not.def.access.package.cant.access: p1.C1, p1"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public class ResolveTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("C2.java:1:31: compiler.err.package.not.visible: p1, (compiler.misc.not.def.access.not.exported.to.module: p1, m1, m2)"))
|
if (!log.contains("C2.java:1:33: compiler.err.not.def.access.package.cant.access: p1.C1, p1"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ public class ResolveTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutput(Task.OutputKind.DIRECT);
|
.getOutput(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
if (!log.contains("C2.java:1:31: compiler.err.package.not.visible: p1, (compiler.misc.not.def.access.does.not.read: m2, p1, m1)"))
|
if (!log.contains("C2.java:1:33: compiler.err.not.def.access.package.cant.access: p1.C1, p1"))
|
||||||
throw new Exception("expected output not found");
|
throw new Exception("expected output not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,7 @@ public class UsesTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
List<String> expected = Arrays.asList("module-info.java:1:31: compiler.err.package.not.visible: p, (compiler.misc.not.def.access.not.exported: p, m1)",
|
List<String> expected = Arrays.asList("module-info.java:1:32: compiler.err.not.def.access.package.cant.access: p.C, p",
|
||||||
"1 error");
|
"1 error");
|
||||||
if (!output.containsAll(expected)) {
|
if (!output.containsAll(expected)) {
|
||||||
throw new Exception("Expected output not found");
|
throw new Exception("Expected output not found");
|
||||||
|
@ -286,7 +286,7 @@ public class UsesTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
List<String> expected = Arrays.asList("module-info.java:1:31: compiler.err.package.not.visible: p, (compiler.misc.not.def.access.not.exported: p, m1)",
|
List<String> expected = Arrays.asList("module-info.java:1:32: compiler.err.not.def.access.package.cant.access: p.C, p",
|
||||||
"1 error");
|
"1 error");
|
||||||
if (!output.containsAll(expected)) {
|
if (!output.containsAll(expected)) {
|
||||||
throw new Exception("Expected output not found");
|
throw new Exception("Expected output not found");
|
||||||
|
|
|
@ -289,7 +289,7 @@ public class XModuleTest extends ModuleTestBase {
|
||||||
.writeAll()
|
.writeAll()
|
||||||
.getOutputLines(Task.OutputKind.DIRECT);
|
.getOutputLines(Task.OutputKind.DIRECT);
|
||||||
|
|
||||||
List<String> expected = Arrays.asList("A.java:1:32: compiler.err.package.not.visible: pkg2, (compiler.misc.not.def.access.does.not.read: m1, pkg2, m2)",
|
List<String> expected = Arrays.asList("A.java:1:36: compiler.err.doesnt.exist: pkg2",
|
||||||
"1 error");
|
"1 error");
|
||||||
|
|
||||||
if (!expected.equals(log))
|
if (!expected.equals(log))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue