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

Annotation with generics causes javac to fail when annotation processor present

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux, windows

      Description

      FULL PRODUCT VERSION :
      java -version:
      java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)


      javac version:
      javac 1.6.0_20


      ADDITIONAL OS VERSION INFORMATION :
      Linux madams-desktop 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:28:05 UTC 2010 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      Note: This bug is a related to bug #6951911 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6951911). I failed to include another scenario that causes compiler failure.

        Description: The following annotation definition causes the javac compiler to fail (error below) when an annotation processor is present:

      @Target( { ElementType.METHOD, ElementType.CONSTRUCTOR })

      @Retention(RetentionPolicy.RUNTIME)

      public @interface RequiresMutability {

          boolean value() default true;


          Class<? extends RuntimeException> flings() default RuntimeException.class;

      }


      This is the annotation processor in use:

      public class DummyProcessor extends AbstractProcessor {
          @Override
          public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
              return false;
          }
      }


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Included the "Source code for an executable test case" section is a base64 encoded zip file with the reproducible test case. Two projects each in their own folder: annproc (compile it first using included compile script), and testcase (see two compile scripts -- the one with an annotation processor on the classpath reproduces the compilation error).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Successful compilation with or without an annotation processor present.
      ACTUAL -
      Compiler failure with annotation processor present. Successful compilation without.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Compiler error:
      madams@madams-desktop:~/dev/testcase$ ./compile-with-dummy-processor
      [parsing started src/main/java/ann/RequiresMutability.java]
      [parsing completed 16ms]
      [parsing started src/main/java/ann/ValidatedTime.java]
      [parsing completed 0ms]
      [search path for source files: ../annproc/target/classes]
      [search path for class files: /home/madams/programs/java/jdk1.6.0_20/jre/lib/resources.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/rt.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/sunrsasign.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/jsse.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/jce.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/charsets.jar,/home/madams/programs/java/jdk1.6.0_20/jre/classes,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/localedata.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/dnsns.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/sunjce_provider.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/sunpkcs11.jar,../annproc/target/classes]
      [loading java/lang/annotation/ElementType.class(java/lang/annotation:ElementType.class)]
      [loading java/lang/annotation/Retention.class(java/lang/annotation:Retention.class)]
      [loading java/lang/annotation/RetentionPolicy.class(java/lang/annotation:RetentionPolicy.class)]
      [loading java/lang/annotation/Target.class(java/lang/annotation:Target.class)]
      [loading java/lang/annotation/Annotation.class(java/lang/annotation:Annotation.class)]
      [loading java/lang/Object.class(java/lang:Object.class)]
      [loading java/lang/Class.class(java/lang:Class.class)]
      [loading java/lang/RuntimeException.class(java/lang:RuntimeException.class)]
      [loading java/lang/Enum.class(java/lang:Enum.class)]
      [loading java/lang/Comparable.class(java/lang:Comparable.class)]
      [loading java/io/Serializable.class(java/io:Serializable.class)]
      [loading java/lang/String.class(java/lang:String.class)]
      Round 1:
      input files: {ann.RequiresMutability, ann.ValidatedTime}
      annotations: [java.lang.annotation.Target, java.lang.annotation.Retention]
      last round: false
      Round 2:
      input files: {}
      annotations: []
      last round: true
      [search path for source files: ../annproc/target/classes]
      [search path for class files: /home/madams/programs/java/jdk1.6.0_20/jre/lib/resources.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/rt.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/sunrsasign.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/jsse.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/jce.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/charsets.jar,/home/madams/programs/java/jdk1.6.0_20/jre/classes,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/localedata.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/dnsns.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/sunjce_provider.jar,/home/madams/programs/java/jdk1.6.0_20/jre/lib/ext/sunpkcs11.jar,../annproc/target/classes]
      [loading java/lang/annotation/ElementType.class(java/lang/annotation:ElementType.class)]
      [loading java/lang/annotation/Retention.class(java/lang/annotation:Retention.class)]
      [loading java/lang/annotation/RetentionPolicy.class(java/lang/annotation:RetentionPolicy.class)]
      [loading java/lang/annotation/Target.class(java/lang/annotation:Target.class)]
      [loading java/lang/annotation/Annotation.class(java/lang/annotation:Annotation.class)]
      [loading java/lang/Object.class(java/lang:Object.class)]
      [loading java/lang/Class.class(java/lang:Class.class)]
      [loading java/lang/RuntimeException.class(java/lang:RuntimeException.class)]
      [loading java/lang/Enum.class(java/lang:Enum.class)]
      [loading java/lang/Comparable.class(java/lang:Comparable.class)]
      [loading java/io/Serializable.class(java/io:Serializable.class)]
      [loading java/lang/String.class(java/lang:String.class)]
      [loading java/lang/Exception.class(java/lang:Exception.class)]
      [loading java/lang/Throwable.class(java/lang:Throwable.class)]
      src/main/java/ann/RequiresMutability.java:13: incompatible types
      found : java.lang.Class<java.lang.RuntimeException>
      required: java.lang.Class<? extends java.lang.RuntimeException>
          Class<? extends RuntimeException> flings() default RuntimeException.class;
                                                                             ^
      src/main/java/ann/ValidatedTime.java:11: incompatible types
      found : ann.ValidatedTime.Precision
      required: ann.ValidatedTime.Precision
          Precision precision() default Precision.SECOND;
                                                 ^
      [checking ann.RequiresMutability]
      [loading java/lang/Exception.class(java/lang:Exception.class)]
      [loading java/lang/Throwable.class(java/lang:Throwable.class)]
      [checking ann.ValidatedTime]
      [loading java/lang/CloneNotSupportedException.class(java/lang:CloneNotSupportedException.class)]
      [total 397ms]
      2 errors


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      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
      eAsAAQToAwAABOgDAABQSwECHgMKAAAAAAAbf6s8AAAAAAAAAAAAAAAAEgAYAAAAAAAAABAA7UGH
      BgAAdGVzdGNhc2Uvc3JjL21haW4vVVQFAAO24OlLdXgLAAEE6AMAAAToAwAAUEsBAh4DCgAAAAAA
      ekysPAAAAAAAAAAAAAAAABcAGAAAAAAAAAAQAO1B0wYAAHRlc3RjYXNlL3NyYy9tYWluL2phdmEv
      VVQFAAPn2OpLdXgLAAEE6AMAAAToAwAAUEsBAh4DCgAAAAAA3EWzPAAAAAAAAAAAAAAAABsAGAAA
      AAAAAAAQAO1BJAcAAHRlc3RjYXNlL3NyYy9tYWluL2phdmEvYW5uL1VUBQAD7wf0S3V4CwABBOgD
      AAAE6AMAAFBLAQIeAxQAAAAIAH1FszxDJeLd2wAAAKoBAAAtABgAAAAAAAEAAACkgXkHAAB0ZXN0
      Y2FzZS9zcmMvbWFpbi9qYXZhL2Fubi9WYWxpZGF0ZWRUaW1lLmphdmFVVAUAAz4H9Et1eAsAAQTo
      AwAABOgDAABQSwECHgMUAAAACADcRbM8yyhFgeoAAAC5AQAAMgAYAAAAAAABAAAApIG7CAAAdGVz
      dGNhc2Uvc3JjL21haW4vamF2YS9hbm4vUmVxdWlyZXNNdXRhYmlsaXR5LmphdmFVVAUAA+8H9Et1
      eAsAAQToAwAABOgDAABQSwECHgMUAAAACACJRbM82ayIUoQAAADJAAAAJQAYAAAAAAABAAAA7YER
      CgAAdGVzdGNhc2UvY29tcGlsZS13aXRoLWR1bW15LXByb2Nlc3NvclVUBQADUQf0S3V4CwABBOgD
      AAAE6AMAAFBLBQYAAAAAFgAWADkIAAD0CgAAAAA=
      ---------- END SOURCE ----------
      UPDATED DESCRIPTION:

      Testcase provided by Licensee and uploaded to attachment.
      Testcase is Not reproducible using JDK 7 b44 and higher.

      See Comments for additional detail that is Licensee specific.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jjg Jonathan Gibbons
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: