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 132249 Details for
Bug 272706
[Model] Generics lost on IField when coming from .class files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_272706.txt (text/plain), 2.36 KB, created by
Olivier Thomann
on 2009-04-17 10:53:19 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2009-04-17 10:53:19 EDT
Size:
2.36 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClassFileTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java,v >retrieving revision 1.41 >diff -u -r1.41 ClassFileTests.java >--- src/org/eclipse/jdt/core/tests/model/ClassFileTests.java 8 Apr 2009 22:52:51 -0000 1.41 >+++ src/org/eclipse/jdt/core/tests/model/ClassFileTests.java 17 Apr 2009 14:53:34 -0000 >@@ -84,6 +84,12 @@ > "package generic;\n" + > "public class V extends X<Thread> implements I<String> {\n" + > "}", >+ "generic/GenericField.java", >+ "package generic;\n" + >+ "import java.util.List;\n" + >+ "public class GenericField {\n" + >+ " protected List<String> myField;\n" + >+ "}", > "annotated/X.java", > "package annotated;\n" + > "@MyOtherAnnot\n" + >@@ -1394,4 +1400,15 @@ > assertEquals("Wrong value", 0xBA, bytes[2] & 0xFF); > assertEquals("Wrong value", 0xBE, bytes[3] & 0xFF); > } >+/* >+ * Ensures that the annotations of a binary field are correct >+ */ >+public void testGenericFieldGetgetTypeSignature() throws JavaModelException { >+ IType type = this.jarRoot.getPackageFragment("generic").getClassFile("GenericField.class").getType(); >+ IField field = type.getField("myField"); >+ assertEquals( >+ "Wrong type signature", >+ "Ljava.util.List<Ljava.lang.String;>;", >+ field.getTypeSignature()); >+} > } >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/BinaryField.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryField.java,v >retrieving revision 1.41 >diff -u -r1.41 BinaryField.java >--- model/org/eclipse/jdt/internal/core/BinaryField.java 7 Mar 2009 00:58:55 -0000 1.41 >+++ model/org/eclipse/jdt/internal/core/BinaryField.java 17 Apr 2009 14:53:35 -0000 >@@ -75,6 +75,10 @@ > */ > public String getTypeSignature() throws JavaModelException { > IBinaryField info = (IBinaryField) getElementInfo(); >+ char[] genericSignature = info.getGenericSignature(); >+ if (genericSignature != null) { >+ return new String(ClassFile.translatedName(genericSignature)); >+ } > return new String(ClassFile.translatedName(info.getTypeName())); > } > /* (non-Javadoc)
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 272706
: 132249 |
132930