Community
Participate
Working Groups
Searched code with compile-errors. I was trying to find a method by its return type and its parameter(s). (off-topic: I did not find a way to search a method by its paramters(s).) Search expression: * String (Collection) Search options: search for method, limit to declarations Error 2005-12-14 08:22:47.395 An internal error occurred during: "Java Search". java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getMethods(SourceTypeBinding.java:835) at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.getMethods(ParameterizedTypeBinding.java:486) at org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchOverriddenMethod(MethodLocator.java:287) at org.eclipse.jdt.internal.core.search.matching.MethodLocator.newDeclarationMatch(MethodLocator.java:471) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:1833) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:2222) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:2023) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1471) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:958) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:999) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1116) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:208) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:424) at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:532) at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:135) at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) eclipse.buildId=I20050627-1435
Please provide test case to help us to reproduce, thx
Created attachment 31718 [details] search this library to reproduce the problem The problem persists when I restrict my working set to ca.odell.glazedlists.impl.beans.BeanTableFormat. Maybe there is a mismatch between binary and source. Sorry, I have no time to check it.
I think the problem is related to the parentheses. The following search expression fails: * String (Collection) The following search expression works: * String Collection
OK, reproduced but string pattern is: "* (Collection) String" Parameters must be put before return type... See javadoc comment of SearchPattern.createMethodOrConstructorPattern(String,int,int,boolean): /** * Method pattern are formed by:<br> * [declaringType '.'] ['<' typeArguments '>'] selector ['(' parameterTypes ')'] [returnType] * <br>e.g.<ul> * <li>java.lang.Runnable.run() void</li> * <li>main(*)</li> * <li><String>toArray(String[])</li> * </ul> * Constructor pattern are formed by:<br> * [declaringQualification '.'] ['<' typeArguments '>'] type ['(' parameterTypes ')'] * <br>e.g.<ul> * <li>java.lang.Object()</li> * <li>Main(*)</li> * <li><Exception>Sample(Exception)</li> * </ul> * Type arguments have the same pattern that for type patterns * @see #createTypePattern(String,int,int,char) */ I doubdt this will be fixed in 3.1 maintenance (severity is minor) but will surely be for 3.2...
Created attachment 31762 [details] Patch to fix this issue Specific eclipse patch format including 2 projects: - org.eclipse.jdt.core - org.eclipse.jdt.core.tests.model
Fixed and released in HEAD. Test cases added to JavaSearchBugsTests
Verified for 3.2 M5 using build I20060214-0010