### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java,v retrieving revision 1.83 diff -u -r1.83 MethodLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 27 Jun 2008 16:04:00 -0000 1.83 +++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 4 Sep 2008 14:27:04 -0000 @@ -21,7 +21,6 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryType; import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.util.SimpleSet; -import org.eclipse.jdt.internal.core.JavaElement; import org.eclipse.jdt.internal.core.search.BasicSearchEngine; public class MethodLocator extends PatternLocator { @@ -498,12 +497,11 @@ IType type = locator.lookupType(declaringClass); if (type == null) return; // case of a secondary type - char[] bindingSelector = methodBinding.selector; - boolean isBinary = type.isBinary(); - IMethod method = null; - TypeBinding[] parameters = methodBinding.original().parameters; - int parameterLength = parameters.length; - if (isBinary) { + // Report match for binary + if (type.isBinary()) { + IMethod method = null; + TypeBinding[] parameters = methodBinding.original().parameters; + int parameterLength = parameters.length; char[][] parameterTypes = new char[parameterLength][]; for (int i = 0; i {\n" + + " public void accept(Visitor visitor) {\n" + + " visitor.visitRelationshipEnd(this);\n" + + " }\n" + + " }\n" + + "}\n" + + "interface Visitor {\n" + + " boolean visitRelationshipEnd(Relationship.End end);\n" + + " boolean visitAssociationEnd(Association.End end);\n" + + "}\n" + + "abstract class ConnectionEnd {\n" + + " public abstract void accept( V visitor );\n" + + "}\n" + + "class Association extends Relationship {\n" + + " static public class RelEnd extends Relationship.End {\n" + + " public void accept(Visitor visitor) {\n" + + " visitor.visitAssociationEnd(this);\n" + + " }\n" + + " }\n" + + "}\n" + ); + IType type = this.workingCopies[0].getType("Relationship").getType("End"); + searchDeclarationsOfSentMessages(type, this.resultCollector); + assertSearchResults( + "src/test/Relationship.java boolean test.Visitor.visitRelationshipEnd(Relationship.End) [visitRelationshipEnd(Relationship.End end)] EXACT_MATCH" + ); +} + +/** * @bug 209054: [search] for references to method finds wrong interface call * @test Ensure that searching method reference does not find wrong interface call * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=209054"