Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 24476 Details for
Bug 100772
[1.5][search] Search for declarations in hierarchy reports too many matches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Additional changes which fix other issues
v03.txt (text/plain), 5.10 KB, created by
Frederic Fusier
on 2005-07-08 12:04:24 EDT
(
hide
)
Description:
Additional changes which fix other issues
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2005-07-08 12:04:24 EDT
Size:
5.10 KB
patch
obsolete
>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.249.2.1 >diff -u -r1.249.2.1 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 8 Jul 2005 11:26:41 -0000 1.249.2.1 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 8 Jul 2005 15:54:16 -0000 >@@ -1113,6 +1113,7 @@ > this.nameEnvironment.cleanup(); > manager.flushZipFiles(); > this.bindings = null; >+ this.patternLocator.clear(); > } > } > /** >@@ -2012,9 +2013,7 @@ > > // Clear handle cache > this.methodHandles = null; >- this.bindings.removeKey(this.pattern); > this.patternLocator.mustResolve = locatorMustResolve; >- this.patternLocator.clear(); > } > /** > * Visit the given field declaration and report the nodes that match exactly the >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.56.2.1 >diff -u -r1.56.2.1 MethodLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 8 Jul 2005 11:26:41 -0000 1.56.2.1 >+++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 8 Jul 2005 15:54:16 -0000 >@@ -63,7 +63,7 @@ > /* > * Return whether a type name is in pattern all super declaring types names. > */ >-private boolean isTypeInSuperDeclaringTypeNames(char[][] typeName) { >+boolean isTypeInSuperDeclaringTypeNames(char[][] typeName) { > if (allSuperDeclaringTypeNames == null) return false; > int length = allSuperDeclaringTypeNames.length; > for (int i= 0; i<length; i++) { >@@ -268,7 +268,7 @@ > if (matchMethod == null) { > if (methodParametersEqualsPattern(methods[i].original())) return true; > } else { >- if (methods[i].original().areParametersEqual(matchMethod)) return true; >+ if (methodsHaveSameParameters(methods[i].original(), matchMethod)) return true; > } > } > } >@@ -291,7 +291,7 @@ > if (matchMethod == null) { > if (methodParametersEqualsPattern(methods[i].original())) return true; > } else { >- if (methods[i].original().areParametersEqual(matchMethod)) return true; >+ if (methodsHaveSameParameters(methods[i].original(), matchMethod)) return true; > } > } > } >@@ -439,6 +439,21 @@ > } > return true; > } >+private boolean methodsHaveSameParameters(MethodBinding method, MethodBinding matchMethod) { >+ TypeBinding[] methodParameters = method.parameters; >+ TypeBinding[] matchMethodParameters = matchMethod.parameters; >+ >+ int length = methodParameters==null ? 0 : methodParameters.length; >+ int matchLength = matchMethodParameters==null ? 0 : matchMethodParameters.length; >+ if (length != matchLength) return false; >+ >+ for (int i = 0; i < length; i++) { >+ if (!CharOperation.equals(methodParameters[i].readableName(), matchMethodParameters[i].readableName(), this.isCaseSensitive)) { >+ return false; >+ } >+ } >+ return true; >+} > public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) { > if (elementBinding != null) { > MethodBinding methodBinding = (MethodBinding) elementBinding; >@@ -452,20 +467,18 @@ > } > return null; > } >+ // If method binding override a method in super hierarchy which original match pattern then report match > if (matchOverriddenMethod(methodBinding.declaringClass, methodBinding, null)) { > this.methodDeclarationsWithInvalidParam.put(reference, Boolean.TRUE); > return super.newDeclarationMatch(reference, element, elementBinding, accuracy, length, locator); > } >- if (isTypeInSuperDeclaringTypeNames(methodBinding.declaringClass.compoundName)) { >- MethodBinding patternBinding = locator.getMethodBinding(this.pattern); >- if (patternBinding != null) { >- if (!matchOverriddenMethod(patternBinding.declaringClass, patternBinding, methodBinding)) { >- this.methodDeclarationsWithInvalidParam.put(reference, Boolean.FALSE); >- return null; >- } >+ // If pattern binding override a method in super hierarchy which original match method binding then report match >+ MethodBinding patternBinding = locator.getMethodBinding(this.pattern); >+ if (patternBinding != null) { >+ if (matchOverriddenMethod(patternBinding.declaringClass, patternBinding, methodBinding)) { >+ this.methodDeclarationsWithInvalidParam.put(reference, Boolean.TRUE); >+ return super.newDeclarationMatch(reference, element, elementBinding, accuracy, length, locator); > } >- this.methodDeclarationsWithInvalidParam.put(reference, Boolean.TRUE); >- return super.newDeclarationMatch(reference, element, elementBinding, accuracy, length, locator); > } > this.methodDeclarationsWithInvalidParam.put(reference, Boolean.FALSE); > return null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 100772
:
23641
|
24462
|
24463
| 24476 |
24477