Bug 101080

Summary: NPE during computePriority for problems
Product: [Eclipse Project] JDT Reporter: Philippe Krief <pjkrief>
Component: CoreAssignee: Maxime Daniel <maxime_daniel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, morten-eclipse
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Tentative patch - not fully tested yet
none
Updated patch none

Description Philippe Krief CLA 2005-06-21 12:04:40 EDT
I found this bug several times my my log but I can tell how I produced it...

java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.CompilationResult.computePriority
(CompilationResult.java:118)
at org.eclipse.jdt.internal.compiler.CompilationResult.quickPrioritize
(CompilationResult.java:370)
at org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
(CompilationResult.java:275)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1175)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert
(CompilationUnitResolver.java:251)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:800)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:588)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run
(ASTProvider.java:566)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:563)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:493)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$7.run(JavaEditor.java:3099)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

eclipse.buildId=I20050617-1618
java.version=1.4.2_08
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86


I hope it will help


Thanks
Philippe
Comment 1 Philippe Krief CLA 2005-06-21 12:06:03 EDT
I get also the same kind of stack trace with the following header message:
   Error in JDT Core during AST creation
Comment 2 Maxime Daniel CLA 2005-06-23 04:16:40 EDT
Managed to isolate some of the needed conditions for this to happen (especially,
error in binary file that gets reported - triggers a null context for the error,
need to have more errors than the max errors nb per compilation unit, need to
avoid having regular errors). Haven't got a reliable test case yet though.

(Philippe, any more details will be welcome!)

I believe that the attached patch removes the problem (from an analysis of the
code). This has not undergone full testing yet and should be considered as work
in progress.
Comment 3 Maxime Daniel CLA 2005-06-23 04:19:05 EDT
Created attachment 23826 [details]
Tentative patch - not fully tested yet

The rationale of the patch is to synchronize the lifecycles of two attributes
that are allocated under the same conditions, thus should be accessed under the
same conditions as well.
Comment 4 Philipe Mulet CLA 2005-06-23 15:18:51 EDT
Good candidate for 3.1.1
Comment 5 Maxime Daniel CLA 2005-06-24 09:58:52 EDT
Checked fix proposed in comment #3 against Build id: I20050624-0010 without problem.
Still no reliable test case.
Comment 6 Philippe Krief CLA 2005-06-24 10:10:01 EDT
Maxime, 
I can't provide more input. Sorry about that

Philippe
Comment 7 Maxime Daniel CLA 2005-06-24 10:19:16 EDT
No problem. I believe we have a serious hint about the solution. Thx for your help.
Comment 8 Maxime Daniel CLA 2005-07-19 12:58:35 EDT
Checked the suggested patch against 3.1 maintenance.
Comment 9 Olivier Thomann CLA 2005-09-07 11:46:41 EDT
Update title to reflect the issue.
Comment 10 Olivier Thomann CLA 2005-09-07 12:21:23 EDT
Created attachment 26912 [details]
Updated patch
Comment 11 Olivier Thomann CLA 2005-09-07 14:39:14 EDT
Fixed and released in 3.1 maintenance stream.
We could not get a reproducable test case, but we now managed firstErrors and
problemsMap in a consistent way.
Comment 12 Olivier Thomann CLA 2005-09-09 15:31:04 EDT
Fixed and released in HEAD.
Comment 13 Olivier Thomann CLA 2005-09-20 14:32:17 EDT
Verified using I20050920-0010 for 3.2M2
Comment 14 David Audel CLA 2005-09-26 07:33:47 EDT
Verified using M20050923-1430 for 3.1.1
Comment 15 Philipe Mulet CLA 2005-10-10 07:16:48 EDT
*** Bug 112003 has been marked as a duplicate of this bug. ***