Bug 168088 - SourceTypeConverter NPE in log
Summary: SourceTypeConverter NPE in log
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 96984 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-14 12:31 EST by Martin Aeschlimann CLA
Modified: 2007-05-15 05:08 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (854 bytes, patch)
2006-12-15 14:19 EST, Olivier Thomann CLA
no flags Details | Diff
Better patch (2.87 KB, patch)
2006-12-15 14:24 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 Martin Aeschlimann CLA 2006-12-14 12:31:45 EST
20061214

Found the following exception in the log, don't know when it happend.

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.parseMemberValue(SourceTypeConverter.java:1130)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.convertAnnotations(SourceTypeConverter.java:601)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.convert(SourceTypeConverter.java:370)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.convert(SourceTypeConverter.java:575)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.convert(SourceTypeConverter.java:160)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.buildCompilationUnit(SourceTypeConverter.java:98)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:621)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:542)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:115)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:134)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:300)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1237)
	at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:779)
	at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:697)
	at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:649)
	at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:120)
	at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getTypeHierarchy(SuperTypeHierarchyCache.java:80)
	at org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache.getMethodOverrideTester(SuperTypeHierarchyCache.java:89)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:162)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:129)
	at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:261)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:259)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:71)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:850)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:336)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:322)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:357)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:322)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 1 Olivier Thomann CLA 2006-12-14 13:16:17 EST
This can happen if the positions of the annotations would be wrong (start > end).
A null check can easily be added.
Philippe, do you want to add some logging for this?
Comment 2 Olivier Thomann CLA 2006-12-14 13:29:01 EST
Did you work with annotations today?
Comment 3 Martin Aeschlimann CLA 2006-12-15 03:37:04 EST
Yes, I was working an a quick fix that creates and uses annotations.
Comment 4 Olivier Thomann CLA 2006-12-15 10:30:05 EST
I also got it twice two days ago, but no steps to reproduce.
Comment 5 Olivier Thomann CLA 2006-12-15 14:18:08 EST
I think this can occurs when the annotation is located at the end of the file and that the source has changed before the source type converter was capable of retrieving a subset of the source code to parse the annotation value.
bug 90916 showed a similar problem.
I'll add a null check in the parseMemberValue method.
Comment 6 Olivier Thomann CLA 2006-12-15 14:19:28 EST
Created attachment 55774 [details]
Proposed fix
Comment 7 Olivier Thomann CLA 2006-12-15 14:20:21 EST
Released for 3.3M5.
No regression test. Please check the source code in order to verify that this is fixed.
Comment 8 Olivier Thomann CLA 2006-12-15 14:24:55 EST
Created attachment 55775 [details]
Better patch

This prevents the method invocation and makes the code clearer.
Comment 9 Eric Jodet CLA 2007-02-06 05:25:51 EST
Verified for 3.3 M5 using build I20070205-0009
Comment 10 Jerome Lanneluc CLA 2007-05-15 05:08:00 EDT
*** Bug 96984 has been marked as a duplicate of this bug. ***