Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v retrieving revision 1.242 diff -u -r1.242 MatchLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 11 May 2005 21:08:37 -0000 1.242 +++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 14 May 2005 10:27:49 -0000 @@ -1449,11 +1449,15 @@ System.out.println("Reporting match"); //$NON-NLS-1$ System.out.println("\tResource: " + match.getResource()); //$NON-NLS-2$//$NON-NLS-1$ System.out.println("\tPositions: [offset=" + match.getOffset() + ", length=" + match.getLength() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (this.parser != null && match.getOffset() > 0 && match.getLength() > 0 && !(match.getElement() instanceof BinaryMember)) { - String selection = new String(this.parser.scanner.source, match.getOffset(), match.getLength()); - System.out.println("\tSelection: -->" + selection + "<--"); //$NON-NLS-1$ //$NON-NLS-2$ + try { + if (this.parser != null && match.getOffset() > 0 && match.getLength() > 0 && !(match.getElement() instanceof BinaryMember)) { + String selection = new String(this.parser.scanner.source, match.getOffset(), match.getLength()); + System.out.println("\tSelection: -->" + selection + "<--"); //$NON-NLS-1$ //$NON-NLS-2$ + System.out.println("\tJava element: " + ((JavaElement)match.getElement()).toStringWithAncestors()); //$NON-NLS-1$ + } + } catch (Exception e) { + // it's just for debug purposes... ignore all exceptions in this area } - System.out.println("\tJava element: " + ((JavaElement)match.getElement()).toStringWithAncestors()); //$NON-NLS-1$ System.out.println(match.getAccuracy() == SearchMatch.A_ACCURATE ? "\tAccuracy: EXACT_MATCH" //$NON-NLS-1$ : "\tAccuracy: POTENTIAL_MATCH"); //$NON-NLS-1$ Index: search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java,v retrieving revision 1.51 diff -u -r1.51 MethodLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 9 May 2005 13:19:30 -0000 1.51 +++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 14 May 2005 10:27:49 -0000 @@ -91,8 +91,12 @@ ASTNode[] args = node.arguments; int argsLength = args == null ? 0 : args.length; if (length != argsLength) return IMPOSSIBLE_MATCH; - for (int i = 0; i < argsLength; i++) { - if (!matchesTypeReference(this.pattern.parameterSimpleNames[i], ((Argument) args[i]).type)) return IMPOSSIBLE_MATCH; + // Disable filter on argument syntax to allow generic type search. + // (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=79990) + if (!this.pattern.mustResolveGeneric) { + for (int i = 0; i < argsLength; i++) { + if (!matchesTypeReference(this.pattern.parameterSimpleNames[i], ((Argument) args[i]).type)) return IMPOSSIBLE_MATCH; + } } } @@ -215,6 +219,54 @@ return level; } /** + * Return if pattern method may override a method in super classes + * or or implement one in super interfaces of given type. + * @param type + * @return level + */ +int matchOverriddenMethod(ReferenceBinding type) { + if (type == null) return INACCURATE_MATCH; + int level = IMPOSSIBLE_MATCH; + + // matches superclass + if (!type.isInterface() && !CharOperation.equals(type.compoundName, TypeConstants.JAVA_LANG_OBJECT)) { + if (type.superclass().isParameterizedType()) { + TypeBinding erasure = ((ParameterizedTypeBinding)type.superclass()).erasure(); + if (erasure instanceof ReferenceBinding) { + MethodBinding[] methods = ((ReferenceBinding)erasure).getMethods(this.pattern.selector); + int length = methods.length; + for (int i = 0; i 0) { + int psLength = parameterSimpleNames.length; + try { + ITypeParameter[] typeParameters = this.declaringType.getTypeParameters(); + if (typeParameters != null && typeParameters.length > 0) { + int tpLength = typeParameters.length; + for (int i=0; i