Bug 47909 - Javadoc: NPE while searching a constructor references in jdt-core
Summary: Javadoc: NPE while searching a constructor references in jdt-core
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-02 13:30 EST by Frederic Fusier CLA
Modified: 2003-12-16 09:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2003-12-02 13:30:16 EST
Using HEAD stream (based on v389) and a workspace self-hosting JDTCore, I got a 
NPE while searching references to constructor ASTConverter(Map,boolean).
Caused by: java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression.internalResolv
eType(JavadocAllocationExpression.java:34)
	at 
org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression.resolveType
(JavadocAllocationExpression.java:104)
	at org.eclipse.jdt.internal.compiler.ast.Javadoc.resolve
(Javadoc.java:99)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve
(TypeDeclaration.java:845)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve
(TypeDeclaration.java:889)
	at 
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve
(CompilationUnitDeclaration.java:271)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process
(MatchLocator.java:886)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:604)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:641)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:750)
	at org.eclipse.jdt.core.search.SearchEngine.search
(SearchEngine.java:591)
	at org.eclipse.jdt.core.search.SearchEngine.search
(SearchEngine.java:523)
	at org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute
(JavaSearchOperation.java:96)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:71)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1558)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1577)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:85)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
Comment 1 Frederic Fusier CLA 2003-12-02 13:36:57 EST
This only happens when Javadoc checking options is set.

Problems is due to the fact that JavadocAllocationExpression type is null 
because PossibleMatch.getMainTypeName() return null after bug 32182 fix.

ConstructorLocator.match(Expression,NodeSet) method request constrcutor type 
type name and of course gets a NPE as type is null...

See also bug 45592. The NPE also occured because the type was null for 
JavadocMessageSend...
Comment 2 Frederic Fusier CLA 2003-12-03 13:30:38 EST
Fixed.

After verification, it appears that fix applied for bug 32182 can be removed as 
IClass files were no longer opened to get their name.

Modify JavadocParser.parseParam to always store a receiver for member 
references even if type is not specified.

Clean JavadocAllocationExpression and JavadocMessageSend as the receiverType 
will never be null from now

Test case added to jdt.core.tests.model.JavaSearchJavadocTests
Comment 3 David Audel CLA 2003-12-16 09:59:29 EST
Verified in 3.0M6