lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

Delombok fails with Java 7 #422

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A bunch of people are complaining that the lombok-maven-plugin does not work 
with Java 7.  Sure enough, I get the following exception:

java.lang.VerifyError: (class: lombok/delombok/Delombok, method: delombok 
signature: ()Z) Incompatible argument to function
        at lombok.maven.AbstractDelombokMojo.execute(AbstractDelombokMojo.java:102)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

The above is with Maven 2.2.1, 64-bit Java 7 update 9, on Windows 7.  I get a 
similar exception with Maven 3.0.4.

Line 102:
  https://github.com/awhitford/lombok.maven/blob/master/lombok-maven-plugin/src/main/java/lombok/maven/AbstractDelombokMojo.java#L102
simply calls:
    final Delombok delombok = new Delombok();

I understand that earlier versions worked fine with Java 7 -- but it failed 
around 0.11.0 or 0.11.2 and continues with 0.11.4.

Original issue reported on code.google.com by anth...@whitford.com on 21 Oct 2012 at 5:32

GoogleCodeExporter commented 9 years ago
If I do this first:
    set MAVEN_OPTS=-noverify
then try 'mvn clean install' again, I get a different error:

[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] 
com.sun.tools.javac.main.JavaCompiler.attribute(Lcom/sun/tools/javac/util/ListBu
ffer;)Lcom/sun/tools/javac/util/List;
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoSuchMethodError: 
com.sun.tools.javac.main.JavaCompiler.attribute(Lcom/sun/tools/javac/util/ListBu
ffer;)Lcom/sun/tools/javac/util/List;
        at lombok.delombok.Delombok.delombok(Delombok.java:384)
        at lombok.maven.AbstractDelombokMojo.execute(AbstractDelombokMojo.java:121)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Original comment by anth...@whitford.com on 21 Oct 2012 at 5:51

GoogleCodeExporter commented 9 years ago
A link to the Java 7 report against lombok-maven-plugin:  
https://github.com/awhitford/lombok.maven/issues/11

Original comment by anth...@whitford.com on 21 Oct 2012 at 5:56

GoogleCodeExporter commented 9 years ago
Yup, thanks. Fixed in master: bde859c8532ae9cc99e1080fd9d27a945b1f68de

Also rolled out an edge release so you can test that the fix works.

Could you let us know if the edge build fixes this for you?

http://projectlombok.org/download-edge.html

NB: The current trunk is a mess, test wise. I fixed the issue where tests fail 
horribly if your local JRE does not match up to the javac6.jar we compile 
against, but now other discrepancies show up. We'll need to rewrite the test 
code to be more heuristic, or more likely, just do some regexp fu or something. 
We'll get there. At any rate, you can test against more things, but, there are 
more errors in the tests. Something to fix for tonight. None of this has an 
effect on lombok itself, just on running the lombok test suite.

Original comment by reini...@gmail.com on 22 Oct 2012 at 7:52

GoogleCodeExporter commented 9 years ago
Confirmed that this version works with Java 7 on Windows.

Original comment by anth...@whitford.com on 26 Oct 2012 at 6:57

GoogleCodeExporter commented 9 years ago
And I also confirmed that this version works with Java 6 on a Mac.

Thank you!

(When will this version be officially released?)

Original comment by anth...@whitford.com on 26 Oct 2012 at 7:03

GoogleCodeExporter commented 9 years ago
Sweet! Marking this one down as verified.

Original comment by reini...@gmail.com on 26 Oct 2012 at 10:41

GoogleCodeExporter commented 9 years ago
Now officially released in lombok v0.11.6.

Original comment by reini...@gmail.com on 30 Oct 2012 at 12:09