Bug 255035 - [compiler] Internal compile error gets reported (NPE)
Summary: [compiler] Internal compile error gets reported (NPE)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 08:50 EST by Dani Megert CLA
Modified: 2008-12-09 11:47 EST (History)
2 users (show)

See Also:


Attachments
Broken source (10.38 KB, text/x-java)
2008-11-12 08:53 EST, Dani Megert CLA
no flags Details
Proposed patch with testcase (5.44 KB, patch)
2008-11-12 14:51 EST, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2008-11-12 08:50:51 EST
I20081111-0800

1. checkout org.eclipse.workbench
2. open TwoPaneElementSelector
3. replace it with attached source
==> many errors in .log and error marker:

Internal compiler error
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.checkAgainstInheritedMethods(MethodVerifier.java:172)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.checkMethods(MethodVerifier.java:445)
	at org.eclipse.jdt.internal.compiler.lookup.MethodVerifier.verify(MethodVerifier.java:875)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.verifyMethods(SourceTypeBinding.java:1605)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.verifyMethods(CompilationUnitScope.java:794)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:740)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
	at java.lang.Thread.run(Thread.java:619)

	TwoPaneElementSelector.java	org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs	line 0	Java Problem
Comment 1 Dani Megert CLA 2008-11-12 08:53:03 EST
Created attachment 117658 [details]
Broken source
Comment 2 Philipe Mulet CLA 2008-11-12 09:37:26 EST
Kent - does it also occur in 3.4.1 ?
Comment 3 Kent Johnson CLA 2008-11-12 10:53:45 EST
This type has 2 methods named validateCurrentSelection & the first has no return type.

Before the change for bug 146768 (fix was only released into 3.5M3 on Oct.17), the verifier never saw the method with no return type, since both methods were tossed.

We need to ensure that any method without a return type is not kept. I'll try to keep the second duplicate method, but if its too tricky I'll throw both away like we did before.
Comment 4 Kent Johnson CLA 2008-11-12 14:51:46 EST
Created attachment 117699 [details]
Proposed patch with testcase

With this patch we keep the first duplicate method that has a return type to avoid reporting secondary errors if we remove all the duplicates.
Comment 5 Kent Johnson CLA 2008-11-14 15:28:12 EST
Fix and test released for 3.5M4
Comment 6 Olivier Thomann CLA 2008-12-09 11:47:18 EST
Verified for 3.5M4 using I20081208-1800