Bug 339891 - NPE when searching for method (with '*' wildcard character)
Summary: NPE when searching for method (with '*' wildcard character)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-14 10:19 EDT by Krzysztof Kosmatka CLA
Modified: 2011-04-25 06:04 EDT (History)
2 users (show)

See Also:


Attachments
JavaSearch settings dialog (27.03 KB, image/png)
2011-03-14 10:22 EDT, Krzysztof Kosmatka CLA
no flags Details
Test java file (145 bytes, text/plain)
2011-03-14 10:27 EDT, Krzysztof Kosmatka CLA
no flags Details
Patch (6.88 KB, patch)
2011-03-17 01:23 EDT, Satyam Kandula CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Kosmatka CLA 2011-03-14 10:19:25 EDT
When I try to find a mathod using a wildcard ('*') as a method name, I get NullPointerException.

What steps will reproduce the problem?
1. Select java file in Package Explorer
2. Open search dialog and set everything according to screenshot. Search string must be a qualified class name folowed by ".*" (dot and asterisk). This have to be a pattern of any method that is referenced in selected java file.
3. Search


-- Error Details --
Date: Mon Mar 14 14:58:26 CET 2011
Message: An internal error occurred during: "Java Search".
Severity: Error
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.core.jobs
Exception Stack Trace:
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.binarySearch(ReferenceBinding.java:102)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getMethods(SourceTypeBinding.java:957)
at org.eclipse.jdt.internal.core.search.matching.MethodLocator.getMethodBinding(MethodLocator.java:54)
at org.eclipse.jdt.internal.core.search.matching.MethodLocator.resolveLevelAsSubtype(MethodLocator.java:684)
at org.eclipse.jdt.internal.core.search.matching.MethodLocator.resolveLevel(MethodLocator.java:651)
at org.eclipse.jdt.internal.core.search.matching.MethodLocator.resolveLevel(MethodLocator.java:574)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:2350)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1669)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1079)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1120)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1252)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:231)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:515)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:582)
at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:144)
at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Olivier Thomann CLA 2011-03-14 10:21:45 EDT
Could you please provide your build id ?
Comment 2 Krzysztof Kosmatka CLA 2011-03-14 10:22:06 EDT
Created attachment 191119 [details]
JavaSearch settings dialog

This is JavaSearch settings dialog, that causes the problem
Comment 3 Krzysztof Kosmatka CLA 2011-03-14 10:24:29 EDT
Version: 3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L
Build id: M20100909-0800
Comment 4 Krzysztof Kosmatka CLA 2011-03-14 10:27:57 EDT
Created attachment 191120 [details]
Test java file

This is simple java file to show the problem. When i have this file in workspace, select it in Package Explorer an perform search with settings shown on screenshot, then i get error.
Comment 5 Krzysztof Kosmatka CLA 2011-03-14 10:30:58 EDT
Previous build id was for Eclipse Platform.

Following is build id for Eclipse Java EE IDE:
Version: 1.3.1.20100916-1202
Build id: 20100917-0705
Comment 6 Olivier Thomann CLA 2011-03-14 10:33:28 EDT
Satyam, please investigate if you can reproduce with 3.6.2 and 3.7?
Thanks.
Comment 7 Satyam Kandula CLA 2011-03-14 11:07:16 EDT
I am able to reproduce this issue with 3.7. I will look into the problem.
Comment 8 Satyam Kandula CLA 2011-03-17 01:23:33 EDT
Created attachment 191377 [details]
Patch

The method name from the pattern is being used in some checks. In this patch, I have made changes to make use of the method name that needs to be used rather than the name from the pattern.
Comment 9 Satyam Kandula CLA 2011-03-17 01:37:30 EDT
Released on HEAD
Comment 10 Jay Arthanareeswaran CLA 2011-04-25 06:04:47 EDT
Verified for 3.7M7 using build I20110421-1800