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 199577 Details for
Bug 351964
[performance] Remove unnecessary change to CompletionEngine#acceptBindings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix patch
351964_completionengine_acceptbindings (text/plain), 10.30 KB, created by
Ian Tewksbury
on 2011-07-13 08:59:06 EDT
(
hide
)
Description:
Fix patch
Filename:
MIME Type:
Creator:
Ian Tewksbury
Created:
2011-07-13 08:59:06 EDT
Size:
10.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.core >Index: src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.67.2.8 >diff -u -r1.67.2.8 CompletionEngine.java >--- src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java 1 Jul 2011 22:12:20 -0000 1.67.2.8 >+++ src/org/eclipse/wst/jsdt/internal/codeassist/CompletionEngine.java 13 Jul 2011 12:58:20 -0000 >@@ -780,8 +780,7 @@ > * @param onlyConstructors <code>true</code> if only constructors should be accepted, > * <code>false</code> otherwise. Only applies when matching on {@link Binding#METHOD}s. > */ >- private void acceptBindings(char[] name,boolean exactMatch, boolean prefixRequired, >- boolean onlyConstructors) { >+ private void acceptBindings(char[] name,boolean exactMatch, boolean prefixRequired) { > > if(this.acceptedBindings == null) return; > >@@ -831,92 +830,91 @@ > > if (binding2 instanceof MethodBinding && binding2.isValidBinding()) { > MethodBinding method = (MethodBinding) binding2; >- if(!onlyConstructors || (onlyConstructors && method.isConstructor())) { > >- int relevance = computeBaseRelevance(); >- relevance += computeRelevanceForInterestingProposal(); >- if (name != null) relevance += computeRelevanceForCaseMatching(name, bindingName); >- relevance += computeRelevanceForExpectingType(method.returnType); >- relevance += computeRelevanceForQualification(prefixRequired); >- relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); >- >- //figure out the parameters >- int parametersLength=method.original().parameters.length; >- char[][] parameterPackageNames = new char[parametersLength][]; >- char[][] parameterFullTypeNames = new char[parametersLength][]; >- for (int j = 0; j < parametersLength; j++) { >- TypeBinding type = method.parameters[j]; >- parameterPackageNames[j] = type.qualifiedPackageName(); >- parameterFullTypeNames[j] = type.qualifiedSourceName(); >- } >- char[][] parameterNames = findMethodParameterNames(method, parameterFullTypeNames); >- >- this.noProposal = false; >- // Standard proposal >- if(!this.requestor.isIgnored(CompletionProposal.METHOD_REF) && (this.assistNodeInJavadoc & CompletionOnJavadoc.ONLY_INLINE_TAG) == 0) { >- CompletionProposal proposal = this.createProposal(CompletionProposal.METHOD_REF, this.actualCompletionPosition); >- proposal.setDeclarationSignature(getSignature(method.declaringClass)); >- proposal.setSignature(getSignature(method)); >- MethodBinding original = method.original(); >- if(original != method) { >- proposal.setOriginalSignature(getSignature(original)); >- } >- proposal.setDeclarationPackageName(packageName); >- proposal.setDeclarationTypeName(method.declaringClass.qualifiedSourceName()); >- proposal.setParameterPackageNames(parameterPackageNames); >- proposal.setParameterTypeNames(parameterFullTypeNames); >- >- if(method.returnType!=null) { >- proposal.setPackageName(method.returnType.qualifiedPackageName()); >- proposal.setTypeName(method.returnType.qualifiedSourceName()); >- }else { >- proposal.setTypeName(null); >- } >- >- >- proposal.setName(bindingName); >- proposal.setCompletion(completion); >- proposal.setFlags(modifiers); >- proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >- proposal.setRelevance(relevance); >- if(parameterNames != null) proposal.setParameterNames(parameterNames); >- proposal.setIsContructor(method.isConstructor()); >- this.requestor.accept(proposal); >- if(DEBUG) { >- this.printDebug(proposal); >- } >+ >+ int relevance = computeBaseRelevance(); >+ relevance += computeRelevanceForInterestingProposal(); >+ if (name != null) relevance += computeRelevanceForCaseMatching(name, bindingName); >+ relevance += computeRelevanceForExpectingType(method.returnType); >+ relevance += computeRelevanceForQualification(prefixRequired); >+ relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); >+ >+ //figure out the parameters >+ int parametersLength=method.original().parameters.length; >+ char[][] parameterPackageNames = new char[parametersLength][]; >+ char[][] parameterFullTypeNames = new char[parametersLength][]; >+ for (int j = 0; j < parametersLength; j++) { >+ TypeBinding type = method.parameters[j]; >+ parameterPackageNames[j] = type.qualifiedPackageName(); >+ parameterFullTypeNames[j] = type.qualifiedSourceName(); >+ } >+ char[][] parameterNames = findMethodParameterNames(method, parameterFullTypeNames); >+ >+ this.noProposal = false; >+ // Standard proposal >+ if(!this.requestor.isIgnored(CompletionProposal.METHOD_REF) && (this.assistNodeInJavadoc & CompletionOnJavadoc.ONLY_INLINE_TAG) == 0) { >+ CompletionProposal proposal = this.createProposal(CompletionProposal.METHOD_REF, this.actualCompletionPosition); >+ proposal.setDeclarationSignature(getSignature(method.declaringClass)); >+ proposal.setSignature(getSignature(method)); >+ MethodBinding original = method.original(); >+ if(original != method) { >+ proposal.setOriginalSignature(getSignature(original)); > } >- >- // Javadoc proposal >- if ((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JSDOC_METHOD_REF)) { >- char[] javadocCompletion = inlineTagCompletion(completion, JavadocTagConstants.TAG_LINK); >- CompletionProposal proposal = this.createProposal(CompletionProposal.JSDOC_METHOD_REF, this.actualCompletionPosition); >- proposal.setDeclarationSignature(getSignature(method.declaringClass)); >- proposal.setSignature(getSignature(method)); >- MethodBinding original = method.original(); >- if(original != method) { >- proposal.setOriginalSignature(getSignature(original)); >- } >- proposal.setDeclarationPackageName(method.declaringClass.qualifiedPackageName()); >- proposal.setDeclarationTypeName(method.declaringClass.qualifiedSourceName()); >- proposal.setParameterPackageNames(parameterPackageNames); >- proposal.setParameterTypeNames(parameterFullTypeNames); >+ proposal.setDeclarationPackageName(packageName); >+ proposal.setDeclarationTypeName(method.declaringClass.qualifiedSourceName()); >+ proposal.setParameterPackageNames(parameterPackageNames); >+ proposal.setParameterTypeNames(parameterFullTypeNames); >+ >+ if(method.returnType!=null) { > proposal.setPackageName(method.returnType.qualifiedPackageName()); > proposal.setTypeName(method.returnType.qualifiedSourceName()); >- proposal.setName(bindingName); >- proposal.setCompletion(javadocCompletion); >- proposal.setFlags( modifiers); >- int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; >- proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >- proposal.setRelevance(relevance+R_INLINE_TAG); >- if(parameterNames != null) proposal.setParameterNames(parameterNames); >- proposal.setIsContructor(method.isConstructor()); >- this.requestor.accept(proposal); >- if(DEBUG) { >- this.printDebug(proposal); >- } >+ }else { >+ proposal.setTypeName(null); >+ } >+ >+ >+ proposal.setName(bindingName); >+ proposal.setCompletion(completion); >+ proposal.setFlags(modifiers); >+ proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); >+ proposal.setRelevance(relevance); >+ if(parameterNames != null) proposal.setParameterNames(parameterNames); >+ proposal.setIsContructor(method.isConstructor()); >+ this.requestor.accept(proposal); >+ if(DEBUG) { >+ this.printDebug(proposal); >+ } >+ } >+ >+ // Javadoc proposal >+ if ((this.assistNodeInJavadoc & CompletionOnJavadoc.TEXT) != 0 && !this.requestor.isIgnored(CompletionProposal.JSDOC_METHOD_REF)) { >+ char[] javadocCompletion = inlineTagCompletion(completion, JavadocTagConstants.TAG_LINK); >+ CompletionProposal proposal = this.createProposal(CompletionProposal.JSDOC_METHOD_REF, this.actualCompletionPosition); >+ proposal.setDeclarationSignature(getSignature(method.declaringClass)); >+ proposal.setSignature(getSignature(method)); >+ MethodBinding original = method.original(); >+ if(original != method) { >+ proposal.setOriginalSignature(getSignature(original)); >+ } >+ proposal.setDeclarationPackageName(method.declaringClass.qualifiedPackageName()); >+ proposal.setDeclarationTypeName(method.declaringClass.qualifiedSourceName()); >+ proposal.setParameterPackageNames(parameterPackageNames); >+ proposal.setParameterTypeNames(parameterFullTypeNames); >+ proposal.setPackageName(method.returnType.qualifiedPackageName()); >+ proposal.setTypeName(method.returnType.qualifiedSourceName()); >+ proposal.setName(bindingName); >+ proposal.setCompletion(javadocCompletion); >+ proposal.setFlags( modifiers); >+ int start = (this.assistNodeInJavadoc & CompletionOnJavadoc.REPLACE_TAG) != 0 ? this.javadocTagPosition : this.startPosition; >+ proposal.setReplaceRange(start - this.offset, this.endPosition - this.offset); >+ proposal.setRelevance(relevance+R_INLINE_TAG); >+ if(parameterNames != null) proposal.setParameterNames(parameterNames); >+ proposal.setIsContructor(method.isConstructor()); >+ this.requestor.accept(proposal); >+ if(DEBUG) { >+ this.printDebug(proposal); > } >- }//end IF only constructors check >+ } > }//end if method binding > else > { >@@ -5962,7 +5960,7 @@ > Binding.METHOD, > this.options.camelCaseMatch, > this); >- acceptBindings(token,false,false,false); >+ acceptBindings(token,false,false); > } > > //propose fields from environment if token length is not 0 >@@ -5973,7 +5971,7 @@ > Binding.VARIABLE, > this.options.camelCaseMatch, > this); >- acceptBindings(token,false,false,false); >+ acceptBindings(token,false,false); > } > } > }
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 351964
: 199577