Community
Participate
Working Groups
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)
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...
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
Verified in 3.0M6