Bug 50746 - Searching for variable references can cause an internal error
Summary: Searching for variable references can cause an internal error
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-28 04:59 EST by Klaus Hammer CLA
Modified: 2004-02-12 15:52 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 Klaus Hammer CLA 2004-01-28 04:59:48 EST
When searching for variable declarations in the workspace, in some cases an 
internal error occurs.

The following is shown in the error properties:

Session Data:

java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86 -install 
file:E:/Programme/eclipse/

Status Details:

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run
(ProgressMonitorDialog.java:357)
	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:238)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:193)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:169)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:456)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:403)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:397)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:72)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
	at org.eclipse.core.launcher.Main.run(Main.java:747)
	at org.eclipse.core.launcher.Main.main(Main.java:583)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.core.SourceMapper.findSourceFileName
(SourceMapper.java:840)
	at 
org.eclipse.jdt.internal.core.search.matching.PotentialMatch.getSourceFileName
(PotentialMatch.java:88)
	at 
org.eclipse.jdt.internal.core.search.matching.PotentialMatch.getQualifiedName
(PotentialMatch.java:125)
	at org.eclipse.jdt.internal.core.search.matching.PotentialMatch.<init>
(PotentialMatch.java:46)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator2.addPotentialMatch
(MatchLocator2.java:201)
	at 
org.eclipse.jdt.internal.core.search.matching.MatchLocator2.locateMatches
(MatchLocator2.java:869)
	at org.eclipse.jdt.core.search.SearchEngine.search
(SearchEngine.java:471)
	at org.eclipse.jdt.core.search.SearchEngine.search
(SearchEngine.java:400)
	at org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute
(JavaSearchOperation.java:90)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:71)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1595)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:85)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
Comment 1 Dani Megert CLA 2004-01-28 05:04:25 EST
>in some cases
Is there a pattern or is it random?
Comment 2 Philipe Mulet CLA 2004-01-28 05:52:04 EST
Offending line shouldn't fail.

   if (type.isMember()) {
     IType enclosingType = type.getDeclaringType();
840> while (enclosingType.getDeclaringType() != null) {
       enclosingType = enclosingType.getDeclaringType();
     }

except on illformed binaries (wrong attributes fooling our decoding support).

Klaus - could you provide us with a testcase ?
Comment 3 Olivier Thomann CLA 2004-01-28 08:49:44 EST
I will investigate as soon as I get a test case.
Comment 4 Olivier Thomann CLA 2004-01-29 12:15:16 EST
Null check has been added.
We would like to understand how this happened.
Could you please provide a test case and reopen the PR.
Thanks.
Comment 5 Olivier Thomann CLA 2004-02-12 15:52:53 EST
Verified in 200402121200.