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

Annotation processing fails due to different ClassType objects for java.lang.String

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8
    • 7
    • tools
    • None
    • generic
    • windows_xp

      Originally reported in 7130514 which was incorrectly closed as Will Not Fix.
      The bug is that an annotation processor processes a class that contains a method:
          String echo (String p1)

      If a .class file exists for this class, then the anno processor reads that and gets a type object for the return type that is different than the type object that is created if the corresponding .java file is processed. This causes the annotation processor to incorrectly conclude that two such echo methods have different return types.

      This occurs in JDK 6, 7, and 8.

      To repro, download the attached bug.tar, untar it, edit the pathname of your jdk into doit.sh, fix the separators if you are not on windows, and then run doit.sh.

            Unassigned Unassigned
            jjh James Holmlund (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: