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 178848 Details for
Bug 325270
[content assist] Parameter names are not displayed for static inner class of an external jar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_325270.txt (text/plain), 4.82 KB, created by
Olivier Thomann
on 2010-09-14 11:51:57 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-09-14 11:51:57 EDT
Size:
4.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java,v >retrieving revision 1.16 >diff -u -r1.16 InternalCompletionProposal.java >--- codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 7 Jul 2010 13:39:03 -0000 1.16 >+++ codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 14 Sep 2010 15:51:05 -0000 >@@ -215,17 +215,17 @@ > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937 > // BinaryType#getMethod() creates a new instance of BinaryMethod, which is a dummy. > // Instead we have to use IType#findMethods() to get a handle to the method of our interest. >- IMethod method = findMethod(type, selector, paramTypeNames); >- >- if (this.hasNoParameterNamesFromIndex) { >- IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot)type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); >- if (packageFragmentRoot.isArchive() || >- this.completionEngine.openedBinaryTypes < getOpenedBinaryTypesThreshold()) { >- SourceMapper mapper = ((JavaElement)method).getSourceMapper(); >- if (mapper != null) { >- try { >+ try { >+ IMethod method = findMethod(type, selector, paramTypeNames); >+ if (this.hasNoParameterNamesFromIndex) { >+ >+ IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot)type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); >+ if (packageFragmentRoot.isArchive() || >+ this.completionEngine.openedBinaryTypes < getOpenedBinaryTypesThreshold()) { >+ SourceMapper mapper = ((JavaElement)method).getSourceMapper(); >+ if (mapper != null) { > char[][] paramNames = mapper.getMethodParameterNames(method); >- >+ > // map source and try to find parameter names > if(paramNames == null) { > if (!packageFragmentRoot.isArchive()) this.completionEngine.openedBinaryTypes++; >@@ -236,36 +236,28 @@ > } > paramNames = mapper.getMethodParameterNames(method); > } >- >+ > if(paramNames != null) { > parameters = paramNames; > } >- } catch(JavaModelException e){ >- //parameters == null; > } > } >- } >- } else { >- try{ >+ } else { > IBinaryMethod info = (IBinaryMethod) ((JavaElement)method).getElementInfo(); > char[][] argumentNames = info.getArgumentNames(); > if (argumentNames != null && argumentNames.length == length) { > parameters = argumentNames; > return parameters; > } >- } catch(JavaModelException e){ >- //parameters == null; >- } >- >- try{ >+ > parameters = new char[length][]; > String[] params = method.getParameterNames(); > for(int i = 0; i< length ; i++){ > parameters[i] = params[i].toCharArray(); > } >- } catch(JavaModelException e){ >- parameters = null; > } >+ } catch(JavaModelException e){ >+ parameters = null; > } > } > >@@ -313,8 +305,8 @@ > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937 > // BinaryType#getMethod() creates a new instance of BinaryMethod, which is a dummy. > // Instead we have to use IType#findMethods() to get a handle to the method of our interest. >- IMethod method = findMethod(type, selector, paramTypeNames); > try{ >+ IMethod method = findMethod(type, selector, paramTypeNames); > parameters = new char[length][]; > String[] params = method.getParameterNames(); > for(int i = 0; i< length ; i++){ >@@ -333,19 +325,20 @@ > return parameters; > } > >- private IMethod findMethod(IType type, char[] selector, char[][] paramTypeNames) { >+ private IMethod findMethod(IType type, char[] selector, char[][] paramTypeNames) throws JavaModelException { > IMethod method = null; > int startingIndex = 0; > String[] args; > IType enclosingType = type.getDeclaringType(); >- // If the method is a constructor of an inner type, add the enclosing type as an >- // additional parameter to the constructor. >- if (enclosingType != null && CharOperation.equals(type.getElementName().toCharArray(), selector)) { >+ // If the method is a constructor of a non-static inner type, add the enclosing type as an >+ // additional parameter to the constructor >+ if (enclosingType != null >+ && CharOperation.equals(type.getElementName().toCharArray(), selector) >+ && !Flags.isStatic(type.getFlags())) { > args = new String[paramTypeNames.length+1]; > startingIndex = 1; > args[0] = Signature.createTypeSignature(enclosingType.getFullyQualifiedName(), true); >- } >- else { >+ } else { > args = new String[paramTypeNames.length]; > } > int length = args.length;
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 325270
:
178845
|
178848
|
178850
|
178851