aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2012-12-18 03:17:43 (EST)
committerzzhongwei2012-12-18 03:17:43 (EST)
commit4e98fc19edfb5b787f163af3c8aa2d981cdd72e0 (patch)
tree2fddb04c6cbfac20e297fc9a04b778d40fe2125b
parentbf38791d4eb8d6d67ed1573e60b7aafad27acbec (diff)
downloadorg.eclipse.pdt-4e98fc19edfb5b787f163af3c8aa2d981cdd72e0.zip
org.eclipse.pdt-4e98fc19edfb5b787f163af3c8aa2d981cdd72e0.tar.gz
org.eclipse.pdt-4e98fc19edfb5b787f163af3c8aa2d981cdd72e0.tar.bz2
395671: Search for class_name::method_name gives wrong results
https://bugs.eclipse.org/bugs/show_bug.cgi?id=395671
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/search/PHPMatchLocator.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/search/PHPMatchLocator.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/search/PHPMatchLocator.java
index 4244590..65284c6 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/search/PHPMatchLocator.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/search/PHPMatchLocator.java
@@ -268,6 +268,7 @@ public class PHPMatchLocator extends MatchLocator {
.getAncestor(IModelElement.SOURCE_MODULE);
if (module != null) {
try {
+ MethodPattern methodPattern = (MethodPattern) pattern;
IModelElement[] elements = module.codeSelect(pce
.getCallName().sourceStart(), 0);
if (elements == null || elements.length == 0) {
@@ -284,7 +285,6 @@ public class PHPMatchLocator extends MatchLocator {
reference);
}
} else {
- MethodPattern methodPattern = (MethodPattern) pattern;
if (methodPattern.declaringSimpleName != null
&& elements[i]
.getAncestor(IModelElement.TYPE) != null
@@ -315,6 +315,16 @@ public class PHPMatchLocator extends MatchLocator {
enclosingElement, accuracy, offset,
length, isConstructor, isSynthetic,
reference);
+ } else if (methodPattern.declaringSimpleName == null
+ && methodPattern.selector != null
+ && new String(methodPattern.selector)
+ .equals(elements[i]
+ .getElementName())) {
+
+ return super.newMethodReferenceMatch(
+ enclosingElement, accuracy, offset,
+ length, isConstructor, isSynthetic,
+ reference);
}
// if (new String(methodPattern.selector)