Community
Participate
Working Groups
Created attachment 157114 [details] test project When Open Attached JSDoc option is chosen for method name NPE is thrown: !ENTRY org.eclipse.ui 4 0 2010-01-25 14:29:07.781 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.corext.javadoc.JavaDocLocations.appendTypePath(JavaDocLocations.java:534) at org.eclipse.wst.jsdt.internal.corext.javadoc.JavaDocLocations.getJavadocLocation(JavaDocLocations.java:488) at org.eclipse.wst.jsdt.ui.JavaScriptUI.getJSdocLocation(JavaScriptUI.java:712) at org.eclipse.wst.jsdt.ui.actions.OpenExternalJavadocAction.run(OpenExternalJavadocAction.java:168) at org.eclipse.wst.jsdt.ui.actions.OpenExternalJavadocAction.run(OpenExternalJavadocAction.java:123) at org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:249) at org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:221) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:230) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:234) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1050) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3931) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3524) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2407) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2371) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2220) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:367) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:611) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:566) at org.eclipse.equinox.launcher.Main.run(Main.java:1363) at org.eclipse.equinox.launcher.Main.main(Main.java:1339) Steps to reproduce: 1. Import attached test project. 2. Extract testJSDoc. 4. Set JSDoc location for folder with extracted JSDoc. 5. Set focus on project (in script explorer). 6. Choose Nagivate->Open Attached JSDoc - it works fine 7. Set cursor on Shape_getColor() function. 8. Choose Nagivate->Open Attached JSDoc - it throws NPE
Created attachment 157115 [details] test JSDoc
It is thrown in org.eclipse.wst.jsdt.internal.corext.javadoc.JavaDocLocation.java: case IJavaScriptElement.METHOD : IMember method= (IMember) element; appendTypePath(method.getDeclaringType(), pathBuffer); if (includeMemberReference) { appendMethodReference((IFunction) method, pathBuffer); } break; Shape_getColor() is detected as method but it doesn't so method.getDeclaringType() returns null. In my opinion it is more overall problem with compatibility with different JSDoc implementations.
More like it doesn't understand how to handle globals. We can direct those to _global_.html fairly easily, but it's unrelated to addressing bug 300677.
Created attachment 188642 [details] Uses _symbol_ for the package/type part of the path for methods and fields that do not have a declaring type
I have reviewed this patch and recommend that it be included in 3.5.1. Chris, can you officially review it.
Correction to Steps to reproduce: 1. Import attached test project. 2. Extract testJSDoc. 4. Set JSDoc location for folder with extracted JSDoc. 5. Set Focus on Test/JavaScript Resources/Test (in script explorer). 6. Choose Nagivate->Open External JSDoc - it works fine 7. Set cursor on Test/JavaScript Resources/Test/Shape_getColor() function. 8. Choose Nagivate->Open External JSDoc - it throws NPE