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 172479 Details for
Bug 316937
JavaElement.getElementInfo(..) throws JavaModelException when trying to get info for an inner class in an external jar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch_316937.txt (text/plain), 4.27 KB, created by
Jay Arthanareeswaran
on 2010-06-23 00:48:03 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-06-23 00:48:03 EDT
Size:
4.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/BinaryMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java,v >retrieving revision 1.105 >diff -u -r1.105 BinaryMethod.java >--- model/org/eclipse/jdt/internal/core/BinaryMethod.java 7 Mar 2009 00:58:57 -0000 1.105 >+++ model/org/eclipse/jdt/internal/core/BinaryMethod.java 23 Jun 2010 04:44:12 -0000 >@@ -157,7 +157,7 @@ > IType type = (IType) getParent(); > SourceMapper mapper = getSourceMapper(); > if (mapper != null) { >- char[][] paramNames = mapper.getMethodParameterNames(this); >+ char[][] paramNames = mapper.getMethodParameterNames(this.name, this.parameterTypes); > > // map source and try to find parameter names > if(paramNames == null) { >@@ -166,7 +166,7 @@ > if (source != null){ > mapper.mapSource(type, source, info); > } >- paramNames = mapper.getMethodParameterNames(this); >+ paramNames = mapper.getMethodParameterNames(this.name, this.parameterTypes); > } > > // if parameter names exist, convert parameter names to String array >Index: model/org/eclipse/jdt/internal/core/SourceMapper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java,v >retrieving revision 1.149 >diff -u -r1.149 SourceMapper.java >--- model/org/eclipse/jdt/internal/core/SourceMapper.java 10 Dec 2009 16:00:06 -0000 1.149 >+++ model/org/eclipse/jdt/internal/core/SourceMapper.java 23 Jun 2010 04:44:13 -0000 >@@ -77,6 +77,9 @@ > implements ISourceElementRequestor, SuffixConstants { > > public static boolean VERBOSE = false; >+ >+ private static char PARAM_TYPE_SEPARATOR = ';'; >+ > /** > * Specifies the location of the package fragment roots within > * the zip (empty specifies the default root). <code>null</code> is >@@ -105,6 +108,13 @@ > * Keys are the method handles, entries are <code>char[][]</code>. > */ > protected HashMap parameterNames; >+ >+ /** >+ * Table that maps the method details in in String form >+ * and method handles. The key is a locally constructed String >+ * in the form [methodName];[paramtype1];[paramtype2] >+ */ >+ protected HashMap parameterTypesMap; > > /** > * Table that maps a binary element to its <code>SourceRange</code>s. >@@ -210,6 +220,7 @@ > this.sourcePath = sourcePath; > this.sourceRanges = new HashMap(); > this.parameterNames = new HashMap(); >+ this.parameterTypesMap = new HashMap(); > this.importsTable = new HashMap(); > this.importsCounterTable = new HashMap(); > } >@@ -693,6 +704,30 @@ > public void enterMethod(MethodInfo methodInfo) { > enterAbstractMethod(methodInfo); > } >+ >+ /** >+ * Returns parameters names for the method with the given name and parameter types. >+ * Returns null if no method can be found with the given details or no parameter >+ * names are known for the method. >+ */ >+ public char[][] getMethodParameterNames(String name, String[] paramTypes) { >+ IMethod method = (IMethod)this.parameterTypesMap.get(constructParamTypesString(name, paramTypes)); >+ if (method != null) >+ return getMethodParameterNames(method); >+ return null; >+ } >+ >+ private String constructParamTypesString(String methodName, String[] paramTypes){ >+ StringBuffer buffer = new StringBuffer(methodName).append(';'); >+ if (paramTypes != null) { >+ for (int index=0; index < paramTypes.length; index++) { >+ buffer.append(paramTypes[index]); >+ if (index < paramTypes.length) >+ buffer.append(PARAM_TYPE_SEPARATOR); >+ } >+ } >+ return buffer.toString(); >+ } > private void enterAbstractMethod(MethodInfo methodInfo) { > if (this.typeDepth >= 0) { > this.memberName[this.typeDepth] = new String(methodInfo.name); >@@ -734,6 +769,8 @@ > this.memberName[this.typeDepth], > convertTypeNamesToSigs(this.methodParameterTypes[this.typeDepth])); > >+ this.parameterTypesMap.put(constructParamTypesString(this.memberName[this.typeDepth], convertTypeNamesToSigs(parameterTypes)), method); >+ > // type parameters > if (methodInfo.typeParameters != null) { > for (int i = 0, length = methodInfo.typeParameters.length; i < length; i++) {
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 316937
:
171960
|
172479
|
172729
|
172890
|
175894
|
177811