Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-05-23 16:39:35 +0000
committerStephan Herrmann2019-05-23 16:39:35 +0000
commit8a5e933e1d58a098da3eb3614a9427da14bdedeb (patch)
tree56ead6b950a3757e052f40170a34fac9ab3287e2 /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup
parenta172a7e1f0a12503b40d1e1b01fd700e0d91efcb (diff)
downloadorg.eclipse.objectteams-8a5e933e1d58a098da3eb3614a9427da14bdedeb.tar.gz
org.eclipse.objectteams-8a5e933e1d58a098da3eb3614a9427da14bdedeb.tar.xz
org.eclipse.objectteams-8a5e933e1d58a098da3eb3614a9427da14bdedeb.zip
update jdt.core to I20190522-1800 for 2019-06 M3
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java11
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java7
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java8
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java13
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java1
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java30
9 files changed, 86 insertions, 38 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index 1ff0bb523..d51f79a96 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -660,7 +660,10 @@ void faultInImports() {
this.tempImports = new ImportBinding[numberOfImports];
this.tempImports[0] = getDefaultImports()[0];
this.importPtr = 1;
-
+
+ CompilerOptions compilerOptions = compilerOptions();
+ boolean inJdtDebugCompileMode = compilerOptions.enableJdtDebugCompileMode;
+
// keep static imports with normal imports until there is a reason to split them up
// on demand imports continue to be packages & types. need to check on demand type imports for fields/methods
// single imports change from being just types to types or fields
@@ -686,7 +689,7 @@ void faultInImports() {
}
if (importBinding instanceof PackageBinding) {
PackageBinding uniquePackage = ((PackageBinding)importBinding).getVisibleFor(module(), false);
- if (uniquePackage instanceof SplitPackageBinding) {
+ if (uniquePackage instanceof SplitPackageBinding && !inJdtDebugCompileMode) {
SplitPackageBinding splitPackage = (SplitPackageBinding) uniquePackage;
problemReporter().conflictingPackagesFromModules(splitPackage, module(), importReference.sourceStart, importReference.sourceEnd);
continue nextImport;
@@ -699,7 +702,7 @@ void faultInImports() {
recordImportBinding(new ImportBinding(compoundName, true, importBinding, importReference));
} else {
Binding importBinding = findSingleImport(compoundName, Binding.TYPE | Binding.FIELD | Binding.METHOD, importReference.isStatic());
- if (importBinding instanceof SplitPackageBinding) {
+ if (importBinding instanceof SplitPackageBinding && !inJdtDebugCompileMode) {
SplitPackageBinding splitPackage = (SplitPackageBinding) importBinding;
int sourceEnd = (int)(importReference.sourcePositions[splitPackage.compoundName.length-1] & 0xFFFF);
problemReporter().conflictingPackagesFromModules((SplitPackageBinding) importBinding, module(), importReference.sourceStart, sourceEnd);
@@ -748,7 +751,7 @@ void faultInImports() {
importedPackage = (PackageBinding) findImport(importedPackage.compoundName, false, true);
if (importedPackage != null)
importedPackage = importedPackage.getVisibleFor(module(), true);
- if (importedPackage instanceof SplitPackageBinding) {
+ if (importedPackage instanceof SplitPackageBinding && !inJdtDebugCompileMode) {
SplitPackageBinding splitPackage = (SplitPackageBinding) importedPackage;
int sourceEnd = (int) importReference.sourcePositions[splitPackage.compoundName.length-1];
problemReporter().conflictingPackagesFromModules(splitPackage, module(), importReference.sourceStart, sourceEnd);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
index 0ae478095..c47c7249d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
@@ -104,6 +104,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(invocation, invocation.arguments());
// Invocation Applicability Inference: 18.5.1 & Invocation Type Inference: 18.5.2
+ InferenceContext18 innerCtx = null;
try {
Expression[] arguments = invocation.arguments();
TypeBinding[] argumentTypes = arguments == null ? Binding.NO_PARAMETERS : new TypeBinding[arguments.length];
@@ -111,7 +112,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
argumentTypes[i] = arguments[i].resolvedType;
if (previousMethod instanceof ParameterizedGenericMethodBinding) {
// find the previous inner inference context to see what inference kind this invocation needs:
- InferenceContext18 innerCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) previousMethod);
+ innerCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) previousMethod);
if (innerCtx == null) {
/* No inference context -> the method was likely manufactured by Scope.findExactMethod -> assume it wasn't really poly after all.
-> proceed as for non-poly expressions.
@@ -137,7 +138,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
return FALSE;
return null; // already incorporated
} finally {
- inferenceContext.resumeSuspendedInference(prevInvocation);
+ inferenceContext.resumeSuspendedInference(prevInvocation, innerCtx);
}
} else if (this.left instanceof ConditionalExpression) {
ConditionalExpression conditional = (ConditionalExpression) this.left;
@@ -156,6 +157,8 @@ class ConstraintExpressionFormula extends ConstraintFormula {
} else if (this.left instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) this.left;
BlockScope scope = lambda.enclosingScope;
+ if (this.right instanceof InferenceVariable)
+ return TRUE; // assume inner inference will handle the fine print
if (!this.right.isFunctionalInterface(scope))
return FALSE;
@@ -231,7 +234,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
try {
return inferenceContext.inferFunctionalInterfaceParameterization(lambda, scope, targetTypeWithWildCards);
} finally {
- inferenceContext.resumeSuspendedInference(previous);
+ inferenceContext.resumeSuspendedInference(previous, null);
}
}
}
@@ -312,8 +315,9 @@ class ConstraintExpressionFormula extends ConstraintFormula {
SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(reference, reference.createPseudoExpressions(argumentTypes));
// Invocation Applicability Inference: 18.5.1 & Invocation Type Inference: 18.5.2
+ InferenceContext18 innerContext = null;
try {
- InferenceContext18 innerContext = reference.getInferenceContext((ParameterizedMethodBinding) compileTimeDecl);
+ innerContext = reference.getInferenceContext((ParameterizedMethodBinding) compileTimeDecl);
int innerInferenceKind = determineInferenceKind(compileTimeDecl, argumentTypes, innerContext);
inferInvocationApplicability(inferenceContext, original, argumentTypes, original.isConstructor()/*mimic a diamond?*/, innerInferenceKind);
if (!inferenceContext.computeB3(reference, r, original))
@@ -322,7 +326,7 @@ class ConstraintExpressionFormula extends ConstraintFormula {
} catch (InferenceFailureException e) {
return FALSE;
} finally {
- inferenceContext.resumeSuspendedInference(prevInvocation);
+ inferenceContext.resumeSuspendedInference(prevInvocation, innerContext);
}
}
TypeBinding rPrime = compileTimeDecl.isConstructor() ? compileTimeDecl.declaringClass : compileTimeDecl.returnType.capture(inferenceContext.scope, reference.sourceStart(), reference.sourceEnd());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
index 90052785b..23338e581 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
@@ -21,6 +21,7 @@ import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -160,6 +161,7 @@ public class InferenceContext18 {
public List<ConstraintFormula> constraintsWithUncheckedConversion;
public boolean usesUncheckedConversion;
public InferenceContext18 outerContext;
+ private Set<InferenceContext18> seenInnerContexts;
Scope scope;
LookupEnvironment environment;
ReferenceBinding object; // java.lang.Object
@@ -1624,18 +1626,24 @@ public class InferenceContext18 {
this.usesUncheckedConversion = innerCtx.usesUncheckedConversion;
}
- public void resumeSuspendedInference(SuspendedInferenceRecord record) {
+ public void resumeSuspendedInference(SuspendedInferenceRecord record, InferenceContext18 innerContext) {
// merge inference variables:
+ boolean firstTime = collectInnerContext(innerContext);
if (this.inferenceVariables == null) { // no new ones, assume we aborted prematurely
this.inferenceVariables = record.inferenceVariables;
+ } else if(!firstTime) {
+ // Use a set to eliminate duplicates.
+ final Set<InferenceVariable> uniqueVariables = new LinkedHashSet<>();
+ uniqueVariables.addAll(Arrays.asList(record.inferenceVariables));
+ uniqueVariables.addAll(Arrays.asList(this.inferenceVariables));
+ this.inferenceVariables = uniqueVariables.toArray(new InferenceVariable[uniqueVariables.size()]);
} else {
int l1 = this.inferenceVariables.length;
int l2 = record.inferenceVariables.length;
- // move to back, add previous to front:
System.arraycopy(this.inferenceVariables, 0, this.inferenceVariables=new InferenceVariable[l1+l2], l2, l1);
System.arraycopy(record.inferenceVariables, 0, this.inferenceVariables, 0, l2);
}
-
+
// replace invocation site & arguments:
this.currentInvocation = record.site;
this.invocationArguments = record.invocationArguments;
@@ -1643,6 +1651,16 @@ public class InferenceContext18 {
this.usesUncheckedConversion = record.usesUncheckedConversion;
}
+ private boolean collectInnerContext(final InferenceContext18 innerContext) {
+ if(innerContext == null) {
+ return false;
+ }
+ if(this.seenInnerContexts == null) {
+ this.seenInnerContexts = new HashSet<>();
+ }
+ return this.seenInnerContexts.add(innerContext);
+ }
+
private Substitution getResultSubstitution(final BoundSet result) {
return new Substitution() {
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index bf84736f9..0acfe5881 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -1834,8 +1834,7 @@ private void initializeUsesNullTypeAnnotation() {
this.mayTolerateMissingType = true;
try {
nullable = this.nullableAnnotation != null ? this.nullableAnnotation.getAnnotationType()
- : getType(this.getNullableAnnotationName(), this.UnNamedModule); // FIXME(SHMOD) module for null
- // annotations??
+ : getType(this.getNullableAnnotationName(), this.UnNamedModule); // FIXME(SHMOD) module for null annotations??
nonNull = this.nonNullAnnotation != null ? this.nonNullAnnotation.getAnnotationType()
: getType(this.getNonNullAnnotationName(), this.UnNamedModule);
} finally {
@@ -2063,7 +2062,8 @@ public ReferenceBinding getTypeFromCompoundName(char[][] compoundName, boolean i
}
packageBinding.addType(binding);
}
- } else if (binding == TheNotFoundType) {
+ }
+ if (binding == TheNotFoundType) {
// report the missing class file first
if (!wasMissingType) {
/* Since missing types have been already been complained against while producing binaries, there is no class path
@@ -2455,6 +2455,7 @@ public void reset() {
this.root.reset();
return;
}
+ this.stepCompleted = 0;
this.knownModules = new HashtableOfModule();
this.UnNamedModule = new ModuleBinding.UnNamedModule(this);
this.module = this.UnNamedModule;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
index 953bcebc3..642fe17b1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
@@ -254,7 +254,8 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
this.requires[len] = requiredModule;
}
} else {
- // TODO(SHMOD) report error
+ this.environment.problemReporter.missingModuleAddReads(requiredModuleName);
+ return;
}
// update known packages:
HashtableOfPackage knownPackages = this.environment.knownPackages;
@@ -308,7 +309,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
public void addResolvedExport(PackageBinding declaredPackage, char[][] targetModules) {
int len = this.exportedPackages.length;
if (declaredPackage == null || !declaredPackage.isValidBinding()) {
- // FIXME(SHMOD) use a problem binding? See https://bugs.eclipse.org/518794#c13
+ // TODO(SHMOD) use a problem binding (if needed by DOM clients)? See https://bugs.eclipse.org/518794#c13
return;
}
if (len == 0) {
@@ -324,7 +325,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
public void addResolvedOpens(PackageBinding declaredPackage, char[][] targetModules) {
int len = this.openedPackages.length;
if (declaredPackage == null || !declaredPackage.isValidBinding()) {
- // FIXME(SHMOD) use a problem binding? See https://bugs.eclipse.org/518794#c13
+ // TODO(SHMOD) use a problem binding (if needed by DOM clients)? See https://bugs.eclipse.org/518794#c13
return;
}
if (len == 0) {
@@ -426,7 +427,6 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
Collection<ModuleBinding> allRequires = dependencyCollector().get();
if (allRequires.contains(this)) {
- // TODO(SHMOD): report (when? where?)
return NO_MODULES; // avoid entering unbounded recursion due to cyclic requires
}
ModuleBinding javaBase = this.environment.javaBaseModule();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
index a155b2240..0d3ebbbc3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
@@ -1105,6 +1105,10 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
protected
// SH}
TypeBinding substituteInferenceVariable(InferenceVariable var, TypeBinding substituteType) {
+ ReferenceBinding newEnclosing = this.enclosingType;
+ if (!isStatic() && this.enclosingType != null) {
+ newEnclosing = (ReferenceBinding) this.enclosingType.substituteInferenceVariable(var, substituteType);
+ }
if (this.arguments != null) {
TypeBinding[] newArgs = null;
int length = this.arguments.length;
@@ -1118,7 +1122,9 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
}
}
if (newArgs != null)
- return this.environment.createParameterizedType(this.type, newArgs, this.enclosingType);
+ return this.environment.createParameterizedType(this.type, newArgs, newEnclosing);
+ } else if (TypeBinding.notEquals(newEnclosing, this.enclosingType)) {
+ return this.environment.createParameterizedType(this.type, this.arguments, newEnclosing);
}
return this;
}
@@ -1203,6 +1209,9 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
this.arguments[i].collectInferenceVariables(variables);
}
}
+ if (!isStatic() && this.enclosingType != null) {
+ this.enclosingType.collectInferenceVariables(variables);
+ }
}
/**
@@ -1833,6 +1842,8 @@ public class ParameterizedTypeBinding extends ReferenceBinding implements Substi
for (int i = 0, length = choices.length; i < length; i++) {
MethodBinding method = choices[i];
if (!method.isAbstract() || method.redeclaresPublicObjectMethod(scope)) continue; // (re)skip statics, defaults, public object methods ...
+ if (method.problemId() == ProblemReasons.ContradictoryNullAnnotations)
+ method = ((ProblemMethodBinding) method).closestMatch;
this.singleAbstractMethod[index] = method;
break;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
index c245ca4a3..f9a1e35a2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
@@ -53,6 +53,7 @@ public interface ProblemReasons {
final int NoProperEnclosingInstance = 28;
final int InterfaceMethodInvocationNotBelow18 = 29;
final int NotAccessible = 30; // JLS 6.6.1 - module aspects
+ final int ErrorAlreadyReported = 31;
//{ObjectTeams;
final int NoTeamContext = 50;
final int AnchorNotFinal = 51;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index b5abba129..7dc940495 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -5312,14 +5312,14 @@ public abstract class Scope {
TypeBinding param = parameters[lastIndex]; // is an ArrayBinding by definition
TypeBinding arg = arguments[lastIndex];
if (TypeBinding.notEquals(param, arg)) {
- level = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods);
+ level = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method);
if (level == NOT_COMPATIBLE) {
// expect X[], is it called with X
param = ((ArrayBinding) param).elementsType();
if (tiebreakingVarargsMethods) {
arg = ((ArrayBinding) arg).elementsType();
}
- if (parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods) == NOT_COMPATIBLE)
+ if (parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method) == NOT_COMPATIBLE)
return NOT_COMPATIBLE;
level = VARARGS_COMPATIBLE; // varargs support needed
}
@@ -5329,7 +5329,7 @@ public abstract class Scope {
TypeBinding param = ((ArrayBinding) parameters[lastIndex]).elementsType();
for (int i = lastIndex; i < argLength; i++) {
TypeBinding arg = (tiebreakingVarargsMethods && (i == (argLength - 1))) ? ((ArrayBinding)arguments[i]).elementsType() : arguments[i];
- if (TypeBinding.notEquals(param, arg) && parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods) == NOT_COMPATIBLE)
+ if (TypeBinding.notEquals(param, arg) && parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method) == NOT_COMPATIBLE)
return NOT_COMPATIBLE;
}
} else if (lastIndex != argLength) { // can call foo(int i, X ... x) with foo(1) but NOT foo();
@@ -5345,7 +5345,7 @@ public abstract class Scope {
TypeBinding param = parameters[i];
TypeBinding arg = (tiebreakingVarargsMethods && (i == (argLength - 1))) ? ((ArrayBinding)arguments[i]).elementsType() : arguments[i];
if (TypeBinding.notEquals(arg,param)) {
- int newLevel = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods);
+ int newLevel = parameterCompatibilityLevel(arg, param, env, tiebreakingVarargsMethods, method);
if (newLevel == NOT_COMPATIBLE)
return NOT_COMPATIBLE;
if (newLevel > level)
@@ -5377,12 +5377,16 @@ public abstract class Scope {
return NOT_COMPATIBLE;
}
- private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env, boolean tieBreakingVarargsMethods) {
+ private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env, boolean tieBreakingVarargsMethods, MethodBinding method) {
// only called if env.options.sourceLevel >= ClassFileConstants.JDK1_5
if (arg == null || param == null)
return NOT_COMPATIBLE;
- if (arg.isCompatibleWith(param, this))
+ if (arg instanceof PolyTypeBinding && !((PolyTypeBinding) arg).expression.isPertinentToApplicability(param, method)) {
+ if (arg.isPotentiallyCompatibleWith(param, this))
+ return COMPATIBLE;
+ } else if (arg.isCompatibleWith(param, this)) {
return COMPATIBLE;
+ }
if (tieBreakingVarargsMethods && (this.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_7 || !CompilerOptions.tolerateIllegalAmbiguousVarargsInvocation)) {
/* 15.12.2.5 Choosing the Most Specific Method, ... One variable arity member method named m is more specific than
another variable arity member method of the same name if either ... Only subtypes relationship should be used.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
index 51ed3bf57..db529aa3c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.java
@@ -57,19 +57,25 @@ public ElementValuePair[] getElementValuePairs() {
pair.setMethodBinding(methods[0]);
} // else silently leave a null there
Object value = pair.getValue();
- if (value instanceof UnresolvedReferenceBinding) {
- pair.setValue(((UnresolvedReferenceBinding) value).
- resolve(this.env, false));
- // no parameterized types in annotation values
- } else if (value instanceof Object[]) {
- Object[] values = (Object[]) value;
- for (int j = 0; j < values.length; j++) {
- if (values[j] instanceof UnresolvedReferenceBinding) {
- values[j] = ((UnresolvedReferenceBinding) values[j]).resolve(this.env, false);
+ boolean wasToleratingMissingTypeProcessingAnnotations = this.env.mayTolerateMissingType;
+ this.env.mayTolerateMissingType = true; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=360164
+ try {
+ if (value instanceof UnresolvedReferenceBinding) {
+ pair.setValue(((UnresolvedReferenceBinding) value).
+ resolve(this.env, false));
+ // no parameterized types in annotation values
+ } else if (value instanceof Object[]) {
+ Object[] values = (Object[]) value;
+ for (int j = 0; j < values.length; j++) {
+ if (values[j] instanceof UnresolvedReferenceBinding) {
+ values[j] = ((UnresolvedReferenceBinding) values[j]).resolve(this.env, false);
+ }
}
- }
- } // do nothing for UnresolvedAnnotationBinding-s, since their
- // content is only accessed through get* methods
+ } // do nothing for UnresolvedAnnotationBinding-s, since their
+ // content is only accessed through get* methods
+ } finally {
+ this.env.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations;
+ }
}
this.env = null;
}

Back to the top