JDK-7052360 : (reflect) GenericSignatureFormatError When signature includes nested inner classes
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2011-06-07
  • Updated: 2014-02-24
  • Resolved: 2011-06-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
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
---------------------------------------------------------------------------

Comments
EVALUATION Closing as duplicate of 7054934 as requested. The issue is resolved for the JCK signature test for the time being.
16-06-2011

SUGGESTED FIX See attached webrev.
09-06-2011

EVALUATION This may be a duplicate of long standing bug 6476261. It may have been tickled by the changes to generify javax.swing.JComboBox in 7031551.
07-06-2011