OpenJPA
  1. OpenJPA
  2. OPENJPA-1659

OpenJPA 2.0.0 annotation processor causes plain old Java compilation to fail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: None
    • Environment:
      * javac 1.6.0_18 & 1.6.0_20 on Linux (Ubuntu 10.04 LTS)
      * javac 1.6.0_20 on Windows XP SP3

      Description

      Compiling the annotation whose source is below with openjpa-2.0.0.jar on the classpath fails with the following error; compiling without succeeds. If I remove the file META-INF/services/javax.annotation.processor.Processor from the openjpa-2.0.0.jar, compilation succeeds.

      =====================================
      Compilation log with OpenJPA on classpath:
      =====================================
      $ javac -d target/classes -classpath openjpa-2.0.0.jar src/main/java/ann/ValidatedTime.java -g -verbose -nowarn -target 1.6 -source 1.6
      [parsing started src/main/java/ann/ValidatedTime.java]
      [parsing completed 16ms]
      [search path for source files: openjpa-2.0.0.jar]
      [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,openjpa-2.0.0.jar]
      [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/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.ValidatedTime}

      annotations: [java.lang.annotation.Retention, java.lang.annotation.Target]
      last round: false
      Round 2:
      input files: {}
      annotations: []
      last round: true
      [search path for source files: openjpa-2.0.0.jar]
      [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,openjpa-2.0.0.jar]
      [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/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)]
      src/main/java/ann/ValidatedTime.java:21: incompatible types
      found : ann.ValidatedTime.Precision
      required: ann.ValidatedTime.Precision
      Precision precision() default Precision.SECOND;
      ^
      [checking ann.ValidatedTime]
      [loading java/lang/CloneNotSupportedException.class(java/lang:CloneNotSupportedException.class)]
      [loading java/lang/Class.class(java/lang:Class.class)]
      [total 437ms]
      1 error

      =====================================
      Compilation log without OpenJPA on classpath:
      =====================================
      $ javac -d target/classes src/main/java/ann/ValidatedTime.java -g -verbose -nowarn -target 1.6 -source 1.6[parsing started src/main/java/ann/ValidatedTime.java]
      [parsing completed 16ms]
      [search path for source files: .]
      [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,.]
      [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/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)]
      [checking ann.ValidatedTime]
      [loading java/lang/CloneNotSupportedException.class(java/lang:CloneNotSupportedException.class)]
      [loading java/lang/Class.class(java/lang:Class.class)]
      [wrote target/classes/ann/ValidatedTime$Precision.class]
      [wrote target/classes/ann/ValidatedTime.class]
      [total 352ms]

      =====================================
      Java source file src/main/java/ann/ValidatedTime.java
      =====================================
      package ann;

      import java.lang.annotation.ElementType;
      import java.lang.annotation.Retention;
      import java.lang.annotation.RetentionPolicy;
      import java.lang.annotation.Target;

      @Retention(RetentionPolicy.RUNTIME)
      @Target(ElementType.METHOD)
      public @interface ValidatedTime {
      Precision precision() default Precision.SECOND;

      public enum Precision

      { NANOSECOND, MILLISECOND, SECOND, MINUTE, HOUR }

      }

      1. javac_bug.zip
        5 kB
        Matthew T. Adams
      2. OPENJPA-1659-OffTheHook.zip
        3.67 MB
        Matthew T. Adams
      3. OPENJPA-1659-testcase.zip
        3.66 MB
        Matthew T. Adams

        Activity

        Matthew T. Adams made changes -
        Attachment javac_bug.zip [ 12445069 ]
        Matthew T. Adams made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Matthew T. Adams made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]
        Matthew T. Adams made changes -
        Attachment OPENJPA-1659-OffTheHook.zip [ 12444310 ]
        Matthew T. Adams made changes -
        Field Original Value New Value
        Attachment OPENJPA-1659-testcase.zip [ 12444257 ]
        Matthew T. Adams created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Matthew T. Adams
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development