Bug 43535 - java.lang.reflect.InvocationTargetException / NullPointerException at Open Call Hierarchy
Summary: java.lang.reflect.InvocationTargetException / NullPointerException at Open C...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-23 16:47 EDT by Rajiv Kanaujia CLA
Modified: 2003-10-23 13:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rajiv Kanaujia CLA 2003-09-23 16:47:19 EDT
Doing "Open Call Hierarchy" on a method like written like 
public long getFoo() { return m_foo; }
throws exception. No problem if the same was written as 
public long getFoo() { 
    return m_foo; 
}

Using Eclipse-SDK-I20030923

// Trace followes 
!ENTRY org.eclipse.jdt.ui 4 10001 Sep 23, 2003 16:35:08.757
!MESSAGE Internal Error
!STACK 0
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283)
	at org.eclipse.jface.window.ApplicationWindow$1.run
(ApplicationWindow.java:444)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:84)
	at org.eclipse.jface.window.ApplicationWindow.run
(ApplicationWindow.java:441)
	at org.eclipse.ui.internal.WorkbenchWindow.run
(WorkbenchWindow.java:1596)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyContentProvider.getChild
ren(CallHierarchyContentProvider.java:72)
	at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren
(AbstractTreeViewer.java:700)
	at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren
(StructuredViewer.java:449)
	at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren
(StructuredViewer.java:553)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.run
(AbstractTreeViewer.java:333)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:84)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren
(AbstractTreeViewer.java:321)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel
(AbstractTreeViewer.java:897)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel
(AbstractTreeViewer.java:906)
	at org.eclipse.jface.viewers.AbstractTreeViewer$5.run
(AbstractTreeViewer.java:780)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection
(StructuredViewer.java:796)
	at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged
(AbstractTreeViewer.java:769)
	at org.eclipse.jface.viewers.ContentViewer.setInput
(ContentViewer.java:238)
	at org.eclipse.jface.viewers.StructuredViewer.setInput
(StructuredViewer.java:983)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewer.setMethodWrapper
(CallHierarchyViewer.java:70)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.updateView
(CallHierarchyViewPart.java:914)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.refresh
(CallHierarchyViewPart.java:577)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.setMethod
(CallHierarchyViewPart.java:199)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyUI.openInViewPart
(CallHierarchyUI.java:212)
	at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyUI.open
(CallHierarchyUI.java:199)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.OpenCallHierarchyAction.run
(OpenCallHierarchyAction.java:187)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.OpenCallHierarchyAction.run
(OpenCallHierarchyAction.java:126)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:196)
	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:529)
	at org.eclipse.jface.action.ActionContributionItem.access$4
(ActionContributionItem.java:482)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent
(ActionContributionItem.java:454)
	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:2172)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1862)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2064)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:2047)
	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:298)
	at org.eclipse.core.launcher.Main.run(Main.java:764)
	at org.eclipse.core.launcher.Main.main(Main.java:598)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.parser.Scanner.setSource
(Scanner.java:3017)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse
(Parser.java:5934)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse
(Parser.java:5916)
	at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse
(Parser.java:4663)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.buildBindings
(MatchLocator.java:289)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches
(MatchLocator.java:582)
	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:515)
	at org.eclipse.jdt.core.search.SearchEngine.search
(SearchEngine.java:442)
	at 
org.eclipse.jdt.internal.corext.callhierarchy.CallerMethodWrapper.findChildren
(CallerMethodWrapper.java:67)
	at 
org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.performSearch
(MethodWrapper.java:282)
	at 
org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.doFindChildren
(MethodWrapper.java:220)
	at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.getCalls
(MethodWrapper.java:80)
	at 
org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyContentProvider$MethodWr
apperRunnable.run(CallHierarchyContentProvider.java:40)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
Comment 1 Rajiv Kanaujia CLA 2003-09-23 16:54:20 EDT
It is independent of way you write the code. Therefore, it occurs in both the 
formats 

public long getFoo() { return m_foo; }

and 

public long getFoo() { 
    return m_foo; 
}

Comment 2 John Arthorne CLA 2003-09-23 17:18:17 EDT
The NPE is in the compiler (Scanner.setSource).  Moving to JDT core.
Comment 3 Philipe Mulet CLA 2003-09-23 17:48:25 EDT
Kent, pls check whether it is legite for this scenario to be handled with an 
empty contents. Scanner issue is solved in bug 43485
Comment 4 Kent Johnson CLA 2003-10-23 13:51:09 EDT
We don't answer the empty source anymore