Bug 83219 - NPE in ProblemReporter with duplicate abstract enum methods
Summary: NPE in ProblemReporter with duplicate abstract enum methods
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-19 13:33 EST by Markus Keller CLA
Modified: 2005-02-16 12:37 EST (History)
0 users

See Also:


Attachments
Apply on HEAD (1.15 KB, patch)
2005-01-19 16:35 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-01-19 13:33:33 EST
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)
Comment 1 Olivier Thomann CLA 2005-01-19 16:35:22 EST
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.
Comment 2 Philipe Mulet CLA 2005-01-27 16:01:08 EST
Looks good to me. 
Comment 3 Olivier Thomann CLA 2005-01-27 17:01:06 EST
Fixed and released in HEAD.
Regression test added in EnumTest.test067
Comment 4 David Audel CLA 2005-02-16 12:37:34 EST
Verified in I20050215-2300