Groovy compilation issue after upgrading plugin intellij.version in build.gradle

Hi


In our plugin we have custom ModelBuilderService implementation (CubaModelBuilderImpl.groovy)

After upgrading intellij version from `IC-191.7479.19` to 'IC-192.6718.14' in plugin's build.gradle we have encountered an error in runtime. When running IDE with this updated plugin, we have Invalid pc in LineNumberTable in class file com/haulmont/studio/intellij/project/resolve/CubaModelBuilderImpl on every gradle project refresh. CubaModelBuilderImpl.class seems to be corrupted.

2019-10-21 14:59:47,388 [1995363] INFO - .project.GradleProjectResolver - Gradle project resolve error 
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.10.3-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Initialization script 'C:\Users\gaslov\AppData\Local\Temp\ijinit5.gradle' line: 18
A problem occurred evaluating initialization script.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:49)
...
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating initialization script.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
...
Caused by: java.lang.ClassFormatError: Invalid pc in LineNumberTable in class file com/haulmont/studio/intellij/project/resolve/CubaModelBuilderImpl
at org.gradle.internal.impldep.com.google.common.collect.Iterators.addAll(Iterators.java:357)
at org.gradle.internal.impldep.com.google.common.collect.Lists.newArrayList(Lists.java:147)
at org.gradle.internal.impldep.com.google.common.collect.Lists.newArrayList(Lists.java:129)
at org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder.<init>(ExtraModelBuilder.java:49)
at org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder.<init>(ExtraModelBuilder.java:43)
at JetGradlePlugin.apply(C:\Users\gaslov\AppData\Local\Temp\ijinit5.gradle:18)...

This error caused by ProGuard plugin, that we use for code obfuscation. Without ProGuard processing everything is ok.

The interesting point, that with intellij base version 191.7479.19 we don't have such issue with ProGuard. Comparing bytecode of the classes (before they are processed by ProGuard) compiled with IC-191 and IC-192 I found that there are some LINENUMBER related differences.

The question is how the intellij version can affect Groovy class compilation this way? Any ideas are welcome, Thanks.

1 comment
Comment actions Permalink

Hi Alexander,

I would start investigation from checking out the exact compiler version that is used by IC191 and IC192 to generate classes. Also please check other compilers or instrumenters that are involved in resulting bytecode generation.

Is your project JPMS-modularized? Are there any annotation processors in dependencies that could have been "automatically" discovered and run?

0

Please sign in to leave a comment.