Bug 48725 - Cannot search for local vars in jars.
Summary: Cannot search for local vars in jars.
Status: VERIFIED FIXED
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 M6   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-15 05:41 EST by Thomas M??der CLA
Modified: 2003-12-16 17:12 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 Thomas M??der CLA 2003-12-15 05:41:04 EST
Eclipse 20031211.

1) import a binary plugin with source (I used org.eclipse.ui.workbench).
2) In the following initializer in ActionFactory.class:

	public static final ActionFactory SHOW_VIEW_MENU = new
ActionFactory("showViewMenu") { //$NON-NLS-1$
		/* (non-javadoc) method declared on ActionFactory */
		public IWorkbenchAction create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			IWorkbenchAction action = new ShowViewMenuAction(window);
			action.setId(getId());
			return action;
		}
	};

select action in "action.setID...".
3) search for declarations in workspace (you'll have to get HEAD of jdt.ui for
this to be available).

4) you get an error:

Caused by: java.lang.IllegalArgumentException: Class file name must end with .class.
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.Throwable.<init>(Throwable.java)
	at org.eclipse.jdt.internal.core.PackageFragment.getClassFile(PackageFragment.java)
	at
org.eclipse.jdt.internal.core.util.HandleFactory.createOpenable(HandleFactory.java:145)
	at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:712)
	at
org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:155)
	at
org.eclipse.jdt.internal.core.search.pattern.InternalSearchPattern.findMatches(InternalSearchPattern.java)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:729)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:697)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:678)
	at
org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute(JavaSearchOperation.java:97)
	at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:91)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java)
	at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:105)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
Comment 1 Jerome Lanneluc CLA 2003-12-15 10:47:21 EST
Fixed LocalVariablePattern.findIndexMatches(...) to compute an index like 
document path (i.e. the path to the jar followed by the relative path to 
the .class file in the jar).

Added regression test JavaSearchTests.testLocalVariableReference3()
Comment 2 Thomas M??der CLA 2003-12-16 09:51:47 EST
I'm still seeing the same exception in I-build 200312160010. Did the fix make it
into the I-build?
Comment 3 Jerome Lanneluc CLA 2003-12-16 09:59:18 EST
No. It will be in I200312160800. Please see the JDT Core build notes to see if 
a bug is fixed in a given build.
Comment 4 Jerome Lanneluc CLA 2003-12-16 17:12:31 EST
Verified in I200312161200