Community
Participate
Working Groups
I get the stack trace below. I cannot release code for project on which this occurred. I was able to trace it in the debugger. This were all true: * positions.length == 2 * last == 4 * reference instanceof QualifiedTypeReference * typeBinding instanceof ReferenceBinding * pkgBinding.compoundName.length == 4 Please let me know if you need more information. java.lang.ArrayIndexOutOfBoundsException: 3 at org.eclipse.jdt.internal.core.search.matching.PackageReferenceLocator.matchRepo rtReference(PackageReferenceLocator.java:198) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1349) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1584) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1595) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1439) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process (MatchLocator.java:1102) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:735) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:766) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:863) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches (JavaSearchParticipant.java:94) at org.eclipse.jdt.core.search.SearchEngine.findMatches (SearchEngine.java:469) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:758) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:728)
What build are you using? Any steps to reproduce?
Version: 3.0.0 Build id: 200405211200 -- create a java project saxon -- Create a CVS repository as described here: http://sourceforge.net/cvs/?group_id=29872 -- "Check Out As" on HEAD > saxon7 > net ; check out into an existing project ; saxon ; Finish -- select /saxon3/net/sf/saxon/dom -- Search > Java ; search string: * ; search for: Package ; Limit To: References ; Scope: Selected Resources ; Search !ENTRY org.eclipse.core.runtime 4 2 May 27, 2004 13:33:45.531 !MESSAGE An internal error occurred during: "Search for References to "*" in Selection". !STACK 0 java.lang.ArrayIndexOutOfBoundsException: 3 at org.eclipse.jdt.internal.core.search.matching.PackageReferenceLocator.matchRepo rtReference(PackageReferenceLocator.java:198) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1349) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1584) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching (MatchLocator.java:1439) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process (MatchLocator.java:1102) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:735) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:766) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches (MatchLocator.java:863) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches (JavaSearchParticipant.java:94) at org.eclipse.jdt.core.search.SearchEngine.findMatches (SearchEngine.java:469) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:758) at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run (JavaSearchQuery.java:125) at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run (InternalSearchUI.java:82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
I can reproduce using your steps even with latest builds, thx. It's a side effect of bug 54962 fix.
Finally after deeper analyse, it's not a regression due to bug 54962. In certain circumstances the package binding which is found in matchReportReference method can have more items than positions array of node reference parameter. Last position was not limited in all cases to positions.length...
I've also find problem when last position equals 0 (ie. in fact when we failed to find a valid compound name...). When this case happens, then return immediately.
Fixed and released in HEAD. [jdt-core-internal] Change done in PackageReferencelocator.matchReportReference(ASTNode,...) method. Test case added in JavaSearchTests
Verified in 200405281200