Lines 56-62
Link Here
|
56 |
protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { |
56 |
protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { |
57 |
return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess(); |
57 |
return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess(); |
58 |
} |
58 |
} |
59 |
//public int match(ASTNode node, MatchingNodeSet nodeSet) - SKIP IT |
59 |
public int match(ASTNode node, MatchingNodeSet nodeSet) { |
|
|
60 |
int declarationsLevel = IMPOSSIBLE_MATCH; |
61 |
if (this.pattern.findReferences) { |
62 |
if (node instanceof ImportReference) { |
63 |
// With static import, we can have static method reference in import reference |
64 |
ImportReference importRef = (ImportReference) node; |
65 |
int length = importRef.tokens.length-1; |
66 |
if (importRef.isStatic() && !importRef.onDemand && matchesName(this.pattern.selector, importRef.tokens[length])) { |
67 |
char[][] compoundName = new char[length][]; |
68 |
System.arraycopy(importRef.tokens, 0, compoundName, 0, length); |
69 |
char[] declaringType = CharOperation.concat(pattern.declaringQualification, pattern.declaringSimpleName, '.'); |
70 |
if (matchesName(declaringType, CharOperation.concatWith(compoundName, '.'))) { |
71 |
declarationsLevel = ((InternalSearchPattern)this.pattern).mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; |
72 |
} |
73 |
} |
74 |
} |
75 |
} |
76 |
return nodeSet.addMatch(node, declarationsLevel); |
77 |
} |
60 |
//public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) - SKIP IT |
78 |
//public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) - SKIP IT |
61 |
//public int match(Expression node, MatchingNodeSet nodeSet) - SKIP IT |
79 |
//public int match(Expression node, MatchingNodeSet nodeSet) - SKIP IT |
62 |
//public int match(FieldDeclaration node, MatchingNodeSet nodeSet) - SKIP IT |
80 |
//public int match(FieldDeclaration node, MatchingNodeSet nodeSet) - SKIP IT |
Lines 107-116
Link Here
|
107 |
|
125 |
|
108 |
protected int matchContainer() { |
126 |
protected int matchContainer() { |
109 |
if (this.pattern.findReferences) { |
127 |
if (this.pattern.findReferences) { |
110 |
// need to look almost everywhere to find in javadocs |
128 |
// need to look almost everywhere to find in javadocs and static import |
111 |
return CLASS_CONTAINER | METHOD_CONTAINER | FIELD_CONTAINER; |
129 |
return ALL_CONTAINER; |
112 |
} |
130 |
} |
113 |
return CLASS_CONTAINER; |
131 |
return CLASS_CONTAINER; |
|
|
132 |
} |
133 |
/* (non-Javadoc) |
134 |
* @see org.eclipse.jdt.internal.core.search.matching.PatternLocator#matchLevelAndReportImportRef(org.eclipse.jdt.internal.compiler.ast.ImportReference, org.eclipse.jdt.internal.compiler.lookup.Binding, org.eclipse.jdt.internal.core.search.matching.MatchLocator) |
135 |
* Accept to report match of static field on static import |
136 |
*/ |
137 |
protected void matchLevelAndReportImportRef(ImportReference importRef, Binding binding, MatchLocator locator) throws CoreException { |
138 |
if (importRef.isStatic() && binding instanceof MethodBinding) { |
139 |
super.matchLevelAndReportImportRef(importRef, binding, locator); |
140 |
} |
114 |
} |
141 |
} |
115 |
protected int matchMethod(MethodBinding method) { |
142 |
protected int matchMethod(MethodBinding method) { |
116 |
if (!matchesName(this.pattern.selector, method.selector)) return IMPOSSIBLE_MATCH; |
143 |
if (!matchesName(this.pattern.selector, method.selector)) return IMPOSSIBLE_MATCH; |