-
Bug
-
Resolution: Duplicate
-
P2
-
7
-
generic
-
generic
Since JDK7b143 the following code throws GenericSignatureFormatError:
---------------------------------------------------------------------------
Class c = Class.forName("javax.swing.JComboBox$AccessibleJComboBox");
System.out.println("Class = " + c);
for ( Field f : c.getDeclaredFields()) {
System.out.println(" [FIELD] " + f.getName());
System.out.println(" [TYPE] " + f.getType());
System.out.println(" [GENERICTYPE] " + f.getGenericType());
}
---------------------------------------------------------------------------
The output is:
---------------------------------------------------------------------------
Class = class javax.swing.JComboBox$AccessibleJComboBox
[FIELD] popupList
[TYPE] class javax.swing.JList
[GENERICTYPE] class javax.swing.JList
[FIELD] previousSelectedAccessible
[TYPE] interface javax.accessibility.Accessible
[GENERICTYPE] interface javax.accessibility.Accessible
[FIELD] editorAccessibleContext
[TYPE] class javax.swing.JComboBox$AccessibleJComboBox$EditorAccessibleContext
Exception in thread "main" java.lang.reflect.GenericSignatureFormatError
at sun.reflect.generics.parser.SignatureParser.error(SignatureParser.java:121)
at sun.reflect.generics.parser.SignatureParser.parseSimpleClassTypeSignature(SignatureParser.java:280)
at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignatureSuffix(SignatureParser.java:288)
at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignature(SignatureParser.java:262)
at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:246)
at sun.reflect.generics.parser.SignatureParser.parseTypeSignature(SignatureParser.java:377)
at sun.reflect.generics.parser.SignatureParser.parseTypeSig(SignatureParser.java:175)
at sun.reflect.generics.repository.FieldRepository.parse(FieldRepository.java:52)
at sun.reflect.generics.repository.FieldRepository.parse(FieldRepository.java:42)
at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:74)
at sun.reflect.generics.repository.FieldRepository.<init>(FieldRepository.java:48)
at sun.reflect.generics.repository.FieldRepository.make(FieldRepository.java:66)
at java.lang.reflect.Field.getGenericInfo(Field.java:98)
at java.lang.reflect.Field.getGenericType(Field.java:236)
at testapp.reflect.GenericSignatureFormatError.main(GenericSignatureFormatError.java:21)
---------------------------------------------------------------------------
in JDK7b140, for instance, the code prints:
---------------------------------------------------------------------------
Class = class javax.swing.JComboBox$AccessibleJComboBox
[FIELD] popupList
[TYPE] class javax.swing.JList
[GENERICTYPE] class javax.swing.JList
[FIELD] previousSelectedAccessible
[TYPE] interface javax.accessibility.Accessible
[GENERICTYPE] interface javax.accessibility.Accessible
[FIELD] editorAccessibleContext
[TYPE] class javax.swing.JComboBox$AccessibleJComboBox$EditorAccessibleContext
[GENERICTYPE] class javax.swing.JComboBox$AccessibleJComboBox$EditorAccessibleContext
[FIELD] this$0
[TYPE] class javax.swing.JComboBox
[GENERICTYPE] class javax.swing.JComboBox
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Class c = Class.forName("javax.swing.JComboBox$AccessibleJComboBox");
System.out.println("Class = " + c);
for ( Field f : c.getDeclaredFields()) {
System.out.println(" [FIELD] " + f.getName());
System.out.println(" [TYPE] " + f.getType());
System.out.println(" [GENERICTYPE] " + f.getGenericType());
}
---------------------------------------------------------------------------
The output is:
---------------------------------------------------------------------------
Class = class javax.swing.JComboBox$AccessibleJComboBox
[FIELD] popupList
[TYPE] class javax.swing.JList
[GENERICTYPE] class javax.swing.JList
[FIELD] previousSelectedAccessible
[TYPE] interface javax.accessibility.Accessible
[GENERICTYPE] interface javax.accessibility.Accessible
[FIELD] editorAccessibleContext
[TYPE] class javax.swing.JComboBox$AccessibleJComboBox$EditorAccessibleContext
Exception in thread "main" java.lang.reflect.GenericSignatureFormatError
at sun.reflect.generics.parser.SignatureParser.error(SignatureParser.java:121)
at sun.reflect.generics.parser.SignatureParser.parseSimpleClassTypeSignature(SignatureParser.java:280)
at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignatureSuffix(SignatureParser.java:288)
at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignature(SignatureParser.java:262)
at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:246)
at sun.reflect.generics.parser.SignatureParser.parseTypeSignature(SignatureParser.java:377)
at sun.reflect.generics.parser.SignatureParser.parseTypeSig(SignatureParser.java:175)
at sun.reflect.generics.repository.FieldRepository.parse(FieldRepository.java:52)
at sun.reflect.generics.repository.FieldRepository.parse(FieldRepository.java:42)
at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:74)
at sun.reflect.generics.repository.FieldRepository.<init>(FieldRepository.java:48)
at sun.reflect.generics.repository.FieldRepository.make(FieldRepository.java:66)
at java.lang.reflect.Field.getGenericInfo(Field.java:98)
at java.lang.reflect.Field.getGenericType(Field.java:236)
at testapp.reflect.GenericSignatureFormatError.main(GenericSignatureFormatError.java:21)
---------------------------------------------------------------------------
in JDK7b140, for instance, the code prints:
---------------------------------------------------------------------------
Class = class javax.swing.JComboBox$AccessibleJComboBox
[FIELD] popupList
[TYPE] class javax.swing.JList
[GENERICTYPE] class javax.swing.JList
[FIELD] previousSelectedAccessible
[TYPE] interface javax.accessibility.Accessible
[GENERICTYPE] interface javax.accessibility.Accessible
[FIELD] editorAccessibleContext
[TYPE] class javax.swing.JComboBox$AccessibleJComboBox$EditorAccessibleContext
[GENERICTYPE] class javax.swing.JComboBox$AccessibleJComboBox$EditorAccessibleContext
[FIELD] this$0
[TYPE] class javax.swing.JComboBox
[GENERICTYPE] class javax.swing.JComboBox
---------------------------------------------------------------------------
- relates to
-
JDK-5003916 (reflect) 24 classes from java package cause GenericSignatureFormatError
- Closed
-
JDK-7031551 Generics: JComboBox
- Closed
-
JDK-7052878 javac needs tests for reading/writing generic signature attributes
- Closed
-
JDK-6476261 (reflect) GenericSignatureFormatError When signature includes nested inner classes
- Closed