Community
Participate
Working Groups
When 'Reporting Invalid Javadoc Annotation' compiler option is set, then I got a NPE while looking for references of Boolean.valueOf(boolean) in Working set project 'jdt-core'. Here's the stack of this exception: !ENTRY org.eclipse.jdt.ui 4 10001 Oct 27, 2003 13:00:16.942 !MESSAGE Internal Error !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:386) at org.eclipse.jdt.ui.actions.FindAction.run(FindAction.java:292) at org.eclipse.jdt.ui.actions.FindReferencesAction.run (FindReferencesAction.java:83) at org.eclipse.jdt.ui.actions.FindAction.run(FindAction.java:220) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:194) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:172) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:547) at org.eclipse.jface.action.ActionContributionItem.access$4 (ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent (ActionContributionItem.java:466) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2173) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1863) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1579) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1562) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:299) at org.eclipse.core.launcher.Main.run(Main.java:765) at org.eclipse.core.launcher.Main.main(Main.java:599) Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ast.MessageSend.isSuperAccess (MessageSend.java:116) at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.canBeSeenBy (MethodBinding.java:151) at org.eclipse.jdt.internal.compiler.lookup.Scope.findExactMethod (Scope.java:173) at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod (Scope.java:1650) at org.eclipse.jdt.internal.compiler.ast.AnnotationMessageSend.resolveType (AnnotationMessageSend.java:91) at org.eclipse.jdt.internal.compiler.ast.Annotation.resolve (Annotation.java:132) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveAnnotatio n(AbstractMethodDeclaration.java:366) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve (AbstractMethodDeclaration.java:356) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:852) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:902) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve (CompilationUnitDeclaration.java:271) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process (MatchLocator.java:870) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:603) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:640) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:749) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:572) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:499) 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:1555) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1572) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:85) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:101)
Happens on build I20031023
Problem comes from resolving annotation. If javadoc comment contains @see references on current class method (typically: @see #foo()), then isSuperAccess () method is called which need that receiver of MessageSend was not null. On current class this was not the case :( Fixed by overriding isSuperAccess() in AnnotationMessageSend and AnnotationFieldReference classes. In this case (eg. using current class for references), also set the receiver with a new instance of AnnotationQualifiedTypeReference initialized with the receiverType.compoundName.
Test case testBug45592 added in AnnotationTestMixed.
Using early previous v_382a posted I get a NullPointerException again while searching references in jdt-core of SimpleSet.add(Object) method...
This is a side effect of bug 45958 fix. While searching, this is not possible to get the main file name, so we cannot figure out whether the member name in @see reference may be a constructor or not in JavadocParser.getMember(TypeReference) method). Currently we get a null for the name which makes this NPE happen while resolving the referenced type...
Fixed. Allow that in some circumstances, it is not possible to figure out the name of current type while parsing and set it while resolving (as it was done before...) In this case, assume that we have a reference to a constructor, as if we do not find a constructor matching the member name during the resolution, then we finally try to find a method...
Verified.