Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4983278

GenericSignatureFormatError when attempting getGenericInterfaces(Class.java:752)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • core-libs



      Name: tb29552 Date: 01/24/2004


      FULL PRODUCT VERSION :
      JDK 1.5 alpha

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      import java.lang.reflect.*;
      public class BugTest {
         public static void main(String[] args) {
            Class c = TypeVariable.class;
            Type[] types = c.getGenericInterfaces();
         }
      }
      java.lang.reflect.GenericSignatureFormatError
              at sun.reflect.generics.parser.SignatureParser.error(SignatureParser.java:103)
              at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:233)
              at sun.reflect.generics.parser.SignatureParser.parseZeroOrMoreBounds(SignatureParser.java:399)
              at sun.reflect.generics.parser.SignatureParser.parseFormalTypeParameter(SignatureParser.java:199)
              at sun.reflect.generics.parser.SignatureParser.parseFormalTypeParameters(SignatureParser.java:188)
              at sun.reflect.generics.parser.SignatureParser.parseZeroOrMoreFormalTypeParameters(SignatureParser.java:177)
              at sun.reflect.generics.parser.SignatureParser.parseClassSignature(SignatureParser.java:171)
              at sun.reflect.generics.parser.SignatureParser.parseClassSig(SignatureParser.java:126)
              at sun.reflect.generics.repository.ClassRepository.parse(ClassRepository.java:34)
              at sun.reflect.generics.repository.ClassRepository.parse(ClassRepository.java:23)
              at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:56)
              at sun.reflect.generics.repository.GenericDeclRepository.<init>(GenericDeclRepository.java:30)
              at sun.reflect.generics.repository.ClassRepository.<init>(ClassRepository.java:30)
              at sun.reflect.generics.repository.ClassRepository.make(ClassRepository.java:47)
              at java.lang.Class.getGenericInfo(Class.java:1708)
              at java.lang.Class.getGenericInterfaces(Class.java:748)
              at BugTest.main(BugTest.java:6)
      Exception in thread "main"


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The problem comes when a type parameter extends an interface
      <E extends Comparable> fail
      <E Extends Object &Comparable> work


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.reflect.GenericSignatureFormatError
              at sun.reflect.generics.parser.SignatureParser.error(SignatureParser.java:103)
              at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:233)
              at sun.reflect.generics.parser.SignatureParser.parseZeroOrMoreBounds(SignatureParser.java:399)
              at sun.reflect.generics.parser.SignatureParser.parseFormalTypeParameter(SignatureParser.java:199)
              at sun.reflect.generics.parser.SignatureParser.parseFormalTypeParameters(SignatureParser.java:188)
              at sun.reflect.generics.parser.SignatureParser.parseZeroOrMoreFormalTypeParameters(SignatureParser.java:177)
              at sun.reflect.generics.parser.SignatureParser.parseClassSignature(SignatureParser.java:171)
              at sun.reflect.generics.parser.SignatureParser.parseClassSig(SignatureParser.java:126)
              at sun.reflect.generics.repository.ClassRepository.parse(ClassRepository.java:34)
              at sun.reflect.generics.repository.ClassRepository.parse(ClassRepository.java:23)
              at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:56)
              at sun.reflect.generics.repository.GenericDeclRepository.<init>(GenericDeclRepository.java:30)
              at sun.reflect.generics.repository.ClassRepository.<init>(ClassRepository.java:30)
              at sun.reflect.generics.repository.ClassRepository.make(ClassRepository.java:47)
              at java.lang.Class.getGenericInfo(Class.java:1708)
              at java.lang.Class.getGenericInterfaces(Class.java:748)
              at BugTest.main(BugTest.java:6)
      Exception in thread "main"


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.lang.reflect.*;
      public class BugTest {
         public static void main(String[] args) {
            Class c = TypeVariable.class;
            Type[] types = c.getGenericInterfaces();
         }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround for jdk classes
      (Incident Review ID: 235574)
      ======================================================================

            darcy Joe Darcy
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: