Bug 250958 - [search] NPE when searching for workspace references
Summary: [search] NPE when searching for workspace references
Status: VERIFIED DUPLICATE of bug 325418
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 263451 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-15 10:54 EDT by Mohammed Ajmal CLA
Modified: 2011-01-25 11:41 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mohammed Ajmal CLA 2008-10-15 10:54:05 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Search for references in your workspace to an overridden "hashCode()" method

More information:
Trace:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding$3.compare(ReferenceBinding.java:58)
	at java.util.Arrays.mergeSort(Unknown Source)
	at java.util.Arrays.mergeSort(Unknown Source)
	at java.util.Arrays.mergeSort(Unknown Source)
	at java.util.Arrays.sort(Unknown Source)
	at java.util.Arrays.sort(Unknown Source)
	at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.sortMethods(ReferenceBinding.java:160)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.availableMethods(BinaryTypeBinding.java:237)
	at org.eclipse.jdt.internal.core.search.matching.ClassFileMatchLocator.locateMatches(ClassFileMatchLocator.java:185)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1580)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1040)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1081)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1198)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:223)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:506)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:551)
	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:144)
	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Jerome Lanneluc CLA 2008-10-17 06:29:14 EDT
This works for me. Do you have more details steps to reproduce?
Comment 2 Olivier Thomann CLA 2008-10-17 09:07:12 EDT
Are you using a JRockit VM ?
Comment 3 Mohammed Ajmal CLA 2008-10-17 10:19:47 EDT
I'm using the following JRE:

java version "1.6.0"
Java(TM) SE Runtime Environment (build pwi3260sr2-20080818_01(SR2))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260-20080816_22093 (JIT enabled, AOT enabled)
J9VM - 20080816_022093_lHdSMr
JIT  - r9_20080721_1330ifx2
GC   - 20080724_AA)
JCL  - 20080808_02



As for more detailed steps... sorry, that's literally all I did to run into this problem. I see the trace I pasted earlier every single time.

Now, I tried this on a new workspace, checked out a few plug-ins, and ran the same scenario (Ctrl-Shift-G on overridden hashCode() method) and it worked fine. So maybe I've corrupted my workspace somehow?

Anyway, I figured since you have a trace, you might be able to figure out how this problem might arise.

Hope this helps.
Comment 4 Jerome Lanneluc CLA 2008-10-31 06:32:50 EDT
Unfortunately, the trace doesn't tell enough to know what's wrong. So we would really need steps to reproduce. Sending us your workspace might help.
Comment 5 Olivier Thomann CLA 2009-12-09 10:22:32 EST
Closing as WORKSFORME.
No steps provived.
Reopen if you can help us understanding how you got it.
Comment 6 Satyam Kandula CLA 2009-12-10 00:58:44 EST
Verified for 3.6M4 using Build id: I20091209-0100
Comment 7 Olivier Thomann CLA 2009-12-10 09:05:54 EST
Verified.
Comment 8 Dani Megert CLA 2011-01-12 05:24:45 EST
*** Bug 263451 has been marked as a duplicate of this bug. ***
Comment 9 Dani Megert CLA 2011-01-12 05:26:30 EST
Got the same NPE with the steps from bug 293861 comment 62:

- import the project
https://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/jbide5036/jbide5036b.zip
- select the test.Test.getName method and call Refactor>Rename
Comment 10 Dani Megert CLA 2011-01-12 06:20:56 EST
(In reply to comment #9)
> Got the same NPE with the steps from bug 293861 comment 62:
> 
> - import the project
> https://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/jbide5036/jbide5036b.zip
> - select the test.Test.getName method and call Refactor>Rename

Sorry, you need to use
https://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/jbide5036/jbide5036a.zip
to reproduce it.
Comment 11 Satyam Kandula CLA 2011-01-12 06:24:38 EST
The exception looks the same as I observed in the bug 325418. The patch there does seem to help.
Comment 12 Olivier Thomann CLA 2011-01-12 08:43:02 EST
Satyam, please investigate.
Comment 13 Satyam Kandula CLA 2011-01-17 08:27:04 EST
The NPE mentioned here is the same reason why they are many spurious potential matches as mentioned in bug 325418. The fix for bug 325418 fixes even this. Hence marking this as duplicate.

*** This bug has been marked as a duplicate of bug 325418 ***
Comment 14 Jay Arthanareeswaran CLA 2011-01-25 11:36:52 EST
.
Comment 15 Jay Arthanareeswaran CLA 2011-01-25 11:40:25 EST
Verified for 3.7M5 using build I20110124-1800.
Comment 16 Jay Arthanareeswaran CLA 2011-01-25 11:41:04 EST
.