Skip to content

Commit f5ed1c1

Browse files
Additional test to make sure that PR
eclipse-jdt#4554 does not inadvertently mask problems (See eclipse-jdt#4740 (comment))
1 parent bbe0b40 commit f5ed1c1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ public class TypeDeclaration extends Statement implements ProblemSeverities, Ref
108108
// 17 Sealed Type support
109109
public TypeReference[] permittedTypes;
110110

111+
// TEST ONLY: disable one fix here to challenge another related fix (in TypeSystem):
112+
public static boolean TESTING_GH_2158 = false;
113+
111114
static {
112115
disallowedComponentNames = new HashSet<>(9);
113116
disallowedComponentNames.add("clone"); //$NON-NLS-1$

org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/Scope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3738,7 +3738,7 @@ public boolean hasErasedCandidatesCollisions(TypeBinding one, TypeBinding two, M
37383738
Object value = invocations.get(mec);
37393739
if (value instanceof TypeBinding[]) {
37403740
TypeBinding[] invalidInvocations = (TypeBinding[]) value;
3741-
if (areSignificantlyDifferent(invalidInvocations[0], invalidInvocations[1])) {
3741+
if (TypeDeclaration.TESTING_GH_2158 || areSignificantlyDifferent(invalidInvocations[0], invalidInvocations[1])) {
37423742
problemReporter().superinterfacesCollide(invalidInvocations[0].erasure(), typeRef, invalidInvocations[0], invalidInvocations[1]);
37433743
type.tagBits |= TagBits.HierarchyHasProblems;
37443744
return true;

org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import junit.framework.Test;
2828
import org.eclipse.jdt.core.JavaCore;
2929
import org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.JavacTestOptions.Excuse;
30+
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
3031
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
3132
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
3233

@@ -19365,6 +19366,14 @@ public class DMessageHandlerRegistryImpl<@NonNull C extends DConnection>
1936519366
runner.customOptions = getCompilerOptions();
1936619367
runner.classLibraries = this.LIBS;
1936719368
runner.runConformTest();
19369+
19370+
// challenge other part of the fix:
19371+
TypeDeclaration.TESTING_GH_2158 = true;
19372+
try {
19373+
runner.runConformTest();
19374+
} finally {
19375+
TypeDeclaration.TESTING_GH_2158 = false;
19376+
}
1936819377
}
1936919378
public void testGH2325() {
1937019379
Runner runner = new Runner();

0 commit comments

Comments
 (0)