Bug 3275 - Exception when doing open on selection (1GE30XX)
Summary: Exception when doing open on selection (1GE30XX)
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:52 EDT by Philipe Mulet CLA
Modified: 2002-01-11 09:22 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 Philipe Mulet CLA 2001-10-10 22:52:25 EDT
TM (5/21/2001 17:22:48)
	SDK 109+

	This exception happend when doing <F3>. The type I was trying to open was
	TypeRefLabelProvider.

1 org.eclipse.core.resources 4 Unhandled exception caught in event loop.
Log: Mon May 21 17:21:38 GMT+02:00 2001
4 org.eclipse.ui 0 java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
	at org.eclipse.jdt.internal.core.index.impl.WordEntry.mapRefs(WordEntry.java:136)
	at org.eclipse.jdt.internal.core.index.impl.MergeFactory.mergeReferences(MergeFactory.java:175)
	at org.eclipse.jdt.internal.core.index.impl.MergeFactory.merge(MergeFactory.java:79)
	at org.eclipse.jdt.internal.core.index.impl.Index.merge(Index.java:230)
	at org.eclipse.jdt.internal.core.index.impl.Index.save(Index.java:334)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.search(PatternSearchJob.java:101)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute(PatternSearchJob.java:75)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:175)
	at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:377)
	at org.eclipse.jdt.internal.core.SearchableEnvironment.findTypes(SearchableEnvironment.java:184)
	at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:279)
	at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:139)
	at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:116)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:66)
	at org.eclipse.jdt.internal.ui.javaeditor.OpenOnSelectionAction.run(OpenOnSelectionAction.java:88)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:421)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:373)
	at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:364)
	at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:45)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:53)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:643)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1131)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1008)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:702)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:689)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:857)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:280)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:67)
	at org.eclipse.core.launcher.Main.run(Main.java:299)
	at org.eclipse.core.launcher.UIMain.main(UIMain.java:43)

PM (5/22/2001 10:35:16 AM)
	Another instance of index merge problem.

OT (22/05/2001 11:35:53 AM)
	/**
	 * Changes the references of the wordEntry to match the mapping. For example,<br>
	 * if the current references are [1 3 4]<br>
	 * and mapping is [1 2 3 4 5]<br>
	 * in references 1 becomes mapping[1] = 2, 3->4, and 4->5<br>
	 * => references = [2 4 5].<br>
	 */
	public void mapRefs(int[] mappings) {
		int position= 0;
		for (int i= 0; i < fNumRefs; i++) {
			int map= mappings[fRefs[i]];											<======================= FAILED HERE
			if (map != -1 && map != 0) {
				fRefs[position]= map;
				position++;
			}
		}
		fNumRefs= position;

		//to be changed!
		System.arraycopy(fRefs, 0, (fRefs= new int[fNumRefs]), 0, fNumRefs);
		Util.sort(fRefs);
	}

OT (24/05/2001 3:51:46 PM)
	For now I don't how this case can ever happen. It would be great to have a test case and inspect mappings and fRefs. I think we have a corrupted entry inside the fRefs collection.
Comment 1 Philipe Mulet CLA 2001-10-12 09:51:05 EDT
Closing