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 183902 Details for
Bug 331120
Improvements to Signature API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch + tests
patch.txt (text/plain), 2.55 KB, created by
Srikanth Sankaran
on 2010-11-26 02:32:37 EST
(
hide
)
Description:
Patch + tests
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-11-26 02:32:37 EST
Size:
2.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/Signature.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java,v >retrieving revision 1.98 >diff -u -r1.98 Signature.java >--- model/org/eclipse/jdt/core/Signature.java 20 Oct 2010 14:25:10 -0000 1.98 >+++ model/org/eclipse/jdt/core/Signature.java 26 Nov 2010 07:29:52 -0000 >@@ -974,7 +974,9 @@ > * correct > */ > public static String getElementType(String typeSignature) throws IllegalArgumentException { >- return new String(getElementType(typeSignature.toCharArray())); >+ char[] signature = typeSignature.toCharArray(); >+ char[] elementType = getElementType(signature); >+ return signature == elementType ? typeSignature : new String(elementType); > } > /** > * Returns the number of parameter types in the given method signature. >@@ -1387,7 +1389,9 @@ > * @since 3.1 > */ > public static String getTypeErasure(String parameterizedTypeSignature) throws IllegalArgumentException { >- return new String(getTypeErasure(parameterizedTypeSignature.toCharArray())); >+ char[] signature = parameterizedTypeSignature.toCharArray(); >+ char[] erasure = getTypeErasure(signature); >+ return signature == erasure ? parameterizedTypeSignature : new String(erasure); > } > > /** >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/SignatureTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java,v >retrieving revision 1.51 >diff -u -r1.51 SignatureTests.java >--- src/org/eclipse/jdt/core/tests/model/SignatureTests.java 5 Mar 2010 21:25:00 -0000 1.51 >+++ src/org/eclipse/jdt/core/tests/model/SignatureTests.java 26 Nov 2010 07:29:54 -0000 >@@ -173,6 +173,10 @@ > "Signature#getElementType not correct", "Qlist<Qstring;>;", > Signature.getElementType("[[[[Qlist<Qstring;>;")); > } >+public void testGetElementType2() { >+ String typeSign = "Ljava.util.List;"; >+ assertTrue(Signature.getElementType(typeSign) == typeSign); >+} > /** > * @see Signature > */ >@@ -771,6 +775,18 @@ > ); > } > >+public void testGetTypeErasure9() { >+ String sign = "Ljava.util.List;"; >+ assertTrue(Signature.getTypeErasure(sign) == sign); >+} >+ >+public void testGetTypeErasure10() { >+ assertEquals( >+ "Ljava.util.List;", >+ Signature.getTypeErasure("Ljava.util.List<-[Ljava.lang.Number;>;") >+ ); >+} >+ > /** > * @see Signature > */
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 331120
: 183902