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 178060 Details for
Bug 321276
JDT Core APIs don't recognize InnerClass constructor inside .class files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_322880.txt (text/plain), 2.79 KB, created by
Olivier Thomann
on 2010-09-02 12:34:52 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-09-02 12:34:52 EDT
Size:
2.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/ClassFileInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java,v >retrieving revision 1.48 >diff -u -r1.48 ClassFileInfo.java >--- model/org/eclipse/jdt/internal/core/ClassFileInfo.java 24 Feb 2010 10:44:11 -0000 1.48 >+++ model/org/eclipse/jdt/internal/core/ClassFileInfo.java 2 Sep 2010 16:34:08 -0000 >@@ -244,12 +244,35 @@ > // TODO (jerome) filter out synthetic members > // indexer should not index them as well > // if ((methodInfo.getModifiers() & IConstants.AccSynthetic) != 0) continue; // skip synthetic >+ boolean useGenericSignature = true; > char[] signature = methodInfo.getGenericSignature(); >- if (signature == null) signature = methodInfo.getMethodDescriptor(); >+ if (signature == null) { >+ useGenericSignature = false; >+ signature = methodInfo.getMethodDescriptor(); >+ } >+ String selector = new String(methodInfo.getSelector()); >+ final boolean isConstructor = methodInfo.isConstructor(); >+ if (isConstructor) { >+ selector = type.getElementName(); >+ } > String[] pNames = null; > try { > pNames = Signature.getParameterTypes(new String(signature)); >- } catch (IllegalArgumentException e) { >+ if (isConstructor >+ && useGenericSignature >+ && type.isMember() >+ && !Flags.isStatic(type.getFlags())) { >+ int length = pNames.length; >+ System.arraycopy(pNames, 0, (pNames = new String[length + 1]), 1, length); >+ char[] descriptor = methodInfo.getMethodDescriptor(); >+ final String[] parameterTypes = Signature.getParameterTypes(new String(descriptor)); >+ pNames[0] = parameterTypes[0]; >+ } >+ }catch (IllegalArgumentException e) { >+ // protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature) >+ signature = methodInfo.getMethodDescriptor(); >+ pNames = Signature.getParameterTypes(new String(signature)); >+ } catch (JavaModelException e) { > // protect against malformed .class file (e.g. com/sun/crypto/provider/SunJCE_b.class has a 'a' generic signature) > signature = methodInfo.getMethodDescriptor(); > pNames = Signature.getParameterTypes(new String(signature)); >@@ -260,10 +283,6 @@ > } > char[][] parameterTypes = ClassFile.translatedNames(paramNames); > JavaModelManager manager = JavaModelManager.getJavaModelManager(); >- String selector = new String(methodInfo.getSelector()); >- if (methodInfo.isConstructor()) { >- selector =type.getElementName(); >- } > selector = manager.intern(selector); > for (int j= 0; j < pNames.length; j++) { > pNames[j]= manager.intern(new String(parameterTypes[j]));
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 321276
:
178060
|
178149