Community
Participate
Working Groups
I20050118-1015 NPE in ProblemReporter with duplicate abstract enum methods: enum Numbers { ONE, TWO, THREE; abstract int getSquare(); abstract int getSquare(); } Error Jan 19, 2005 19:30:49.65 An internal error occurred during: "Java AST creation". java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.enumAbstractMethodMustBeImplemented(ProblemReporter.java:1187) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1005) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1067) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:280) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:759) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:475) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:763) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:575) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:563) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:494) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:165) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Created attachment 17309 [details] Apply on HEAD The following patch makes the behavior consistent with an abstract class that has duplicate abstract methods. In this case, we don't report that the abstract methods should be implemented, we simply report an error on the duplication of the same method.
Looks good to me.
Fixed and released in HEAD. Regression test added in EnumTest.test067
Verified in I20050215-2300