Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1397

Java+Groovy compilation fails with Clover enabled in IntelliJ 12.1.x

    • Icon: Bug Bug
    • Resolution: Tracked Elsewhere
    • Icon: Medium Medium
    • won't fix
    • 3.2.0
    • CIJ Plugin
    • None
    • Windows 7, Java 1.7.0_45 64-bit. IntelliJ 12.1.6. Clover plugin 3.2.0

      When building my project in IntelliJ the build fails with the following exception. I saw a couple other similar comments about how using an external build can cause problems but I thought this was fixed with Clover 3.2? If I turn off the external build then the compilation does succeed. The project is a combined Java/Groovy project if that matters. Let me know if you need any more details.

      Error: java.lang.IllegalArgumentException: org.jetbrains.jps.javac.TransformableJavaFileObject
      java.lang.RuntimeException: java.lang.IllegalArgumentException: org.jetbrains.jps.javac.TransformableJavaFileObject
      	at com.sun.tools.javac.main.Main.compile(Main.java:475)
      	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
      	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:167)
      	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:364)
      	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:276)
      	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:190)
      	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:162)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1018)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:742)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:790)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:705)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:526)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:314)
      	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:179)
      	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:129)
      	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:220)
      	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:112)
      	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:132)
      	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      Caused by: java.lang.IllegalArgumentException: org.jetbrains.jps.javac.TransformableJavaFileObject
      	at com.sun.tools.javac.file.JavacFileManager.inferBinaryName(JavacFileManager.java:660)
      	at javax.tools.ForwardingJavaFileManager.inferBinaryName(ForwardingJavaFileManager.java:84)
      	at com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.inferBinaryName(ClientCodeWrapper.java:225)
      	at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2524)
      	at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2505)
      	at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2143)
      	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:421)
      	at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:298)
      	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:459)
      	at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:258)
      	at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:272)
      	at com.sun.tools.javac.comp.Enter.complete(Enter.java:484)
      	at com.sun.tools.javac.comp.Enter.main(Enter.java:469)
      	at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:929)
      	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
      	at com.sun.tools.javac.main.Main.compile(Main.java:439)
      	... 23 more
      
      Problem summary

      This bug occurs when all of the following conditions are met:

      • IDEA 12.1.1 or later is used
      • Clover 3.1.12 or later is used
      • an "external build" feature is enabled (Settings > Compiler > Use external build)
      • project has a mixed Java + Groovy code

      It's an IDEA bug - http://youtrack.jetbrains.com/issue/IDEA-110835 - and has been fixed in IDEA13.

      Therefore:

      • in IDEA 12.x - disable the "external build" feature
      • in IDEA 13.x - problem does not occur

            [CLOV-1397] Java+Groovy compilation fails with Clover enabled in IntelliJ 12.1.x

            In IDEA12 you can use a workaround, i.e. disable the external build option.

            Marek Parfianowicz added a comment - In IDEA12 you can use a workaround, i.e. disable the external build option.

            JoeA added a comment -

            My group has discussed upgrading to IDEA 13, but we haven't done it yet. We'd like to have this fixed for 12, but if we just need to upgrade to 13 we can do that as well. Thanks.

            JoeA added a comment - My group has discussed upgrading to IDEA 13, but we haven't done it yet. We'd like to have this fixed for 12, but if we just need to upgrade to 13 we can do that as well. Thanks.

            I have found a similar issue in JetBrains' bug tracker:

            It's marked as fixed in build 130.1335, which is an IDEA 13 I think (the about box in IDEA13 shows "IDEA 13.0 build #IU-133.193", which is a higher build number). I tested Clover plugin in IDEA13 and this problem indeed does not reproduce (IDEA13 has an external build as the only way of building).

            Marek Parfianowicz added a comment - I have found a similar issue in JetBrains' bug tracker: http://youtrack.jetbrains.com/issue/IDEA-110835 It's marked as fixed in build 130.1335, which is an IDEA 13 I think (the about box in IDEA13 shows "IDEA 13.0 build #IU-133.193", which is a higher build number). I tested Clover plugin in IDEA13 and this problem indeed does not reproduce (IDEA13 has an external build as the only way of building).

            Thanks a lot for information. I'll check what's wrong as soon as I solve the CLOV-1395 blocker. The Clover-for-IDEA plug-in supports compilation of Java code only in IDE. I suspect that the problem could be that for some reason Clover was called on Groovy code as well (joint groovy+java compilation?). But this is my suspicion only.

            I scheduled this bug to 3.2.1 and increased priority to Major as in my opinion it's much more important that you've set initially.

            Cheers

            Marek Parfianowicz added a comment - Thanks a lot for information. I'll check what's wrong as soon as I solve the CLOV-1395 blocker. The Clover-for-IDEA plug-in supports compilation of Java code only in IDE. I suspect that the problem could be that for some reason Clover was called on Groovy code as well (joint groovy+java compilation?). But this is my suspicion only. I scheduled this bug to 3.2.1 and increased priority to Major as in my opinion it's much more important that you've set initially. Cheers

            JoeA added a comment -

            It's a standard project. The project is gradle based and we use that to generate the IntelliJ project files, but I don't think that should matter too much. It is mainly a Java project with a few classes written in Groovy instead of Java.

            JoeA added a comment - It's a standard project. The project is gradle based and we use that to generate the IntelliJ project files, but I don't think that should matter too much. It is mainly a Java project with a few classes written in Groovy instead of Java.

            Thanks no need to check older versions right now. You wrote that you're compiling java+ groovy am I correct? Are you using standard idea plugins for this? Do you have standard idea- based project or maybe a project imported from maven or grails?

            Marek Parfianowicz added a comment - Thanks no need to check older versions right now. You wrote that you're compiling java+ groovy am I correct? Are you using standard idea plugins for this? Do you have standard idea- based project or maybe a project imported from maven or grails?

            JoeA added a comment -

            12.1.4 doesn't seem to work either. I get the same exception. Want me to try with an even older one?

            JoeA added a comment - 12.1.4 doesn't seem to work either. I get the same exception. Want me to try with an even older one?

            Indeed the problem with external build was fixed in 3.1.12. I see that you're using IDEA 12.1.6 which is quite new. May I ask you to check if you see this problem in older Idea like 12.1.1-12.1.4?

            Marek Parfianowicz added a comment - Indeed the problem with external build was fixed in 3.1.12. I see that you're using IDEA 12.1.6 which is quite new. May I ask you to check if you see this problem in older Idea like 12.1.1-12.1.4?

              mparfianowicz Marek Parfianowicz
              a86e82895aec JoeA
              Affected customers:
              0 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: