Skip to content

Commit ce1b71b

Browse files
committed
Improve recovery for missing type argument
1 parent 3400d3c commit ce1b71b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.eclipse.jdt.core.tests.util.Util;
3434
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
3535
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
36+
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
3637

3738
@SuppressWarnings("rawtypes")
3839
public abstract class ConverterTestSetup extends AbstractASTTests {
@@ -1070,6 +1071,8 @@ private boolean matchesAlternateMessage(String original, String expected, int pr
10701071
return ("This instance method cannot override the static method from " + arguments[3]).replaceAll("@interface ", "").equals(expected);
10711072
case IProblem.CannotHideAnInstanceMethodWithAStaticMethod:
10721073
return ("This static method cannot hide the instance method from " + arguments[3]).replaceAll("@interface ", "").equals(expected);
1074+
case IProblem.CannotUseDiamondWithExplicitTypeArguments:
1075+
return new DefaultProblemFactory().getLocalizedMessage(IProblem.CannotUseDiamondWithExplicitTypeArguments, null).equals(expected);
10731076
case IProblem.Syntax:
10741077
return original.equals(switch (expected) {
10751078
case "Syntax error, insert \"Finally\" to complete BlockStatements" -> "'try' without 'catch', 'finally' or resource declarations";

0 commit comments

Comments
 (0)