akshattandon / projectlombok

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

Lombok does not work on eclipse-mars (verifier errors) #802

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Try to edit any java file in eclipse mars with lombok installed, and eclipse 
will blow up with a verifier error.

Original issue reported on code.google.com by reini...@gmail.com on 31 Mar 2015 at 12:14

GoogleCodeExporter commented 9 years ago
The problem is that eclipse has (finally!) distributed their code compiled with 
-target 1.6; up to luna, eclipse's class files were compiled for -target 1.5.

The class verifier has different rules; in particular, 'stack frames' aren't 
required (or legal as far as I know) in 1.5 class files, but they are in 1.6.

We rewrite some of eclipse's classes using ASM, and we ask ASM to give us the 
luxury recalculate frames treatment. Unfortunately, this doesn't work, and 
cannot be made to work, because we don't know the class hierarchy of all of 
eclipse's classes beforehand.

The solution is to manually manage the frames. There is only one patch script 
that appears (we just looked at code for now, haven't tested this theory yet) 
to require frame calculation, and we can avoid it by generating a new method. 
We also have some other ideas to obviate the need for it.

Once we've solved that problem we can run ASM in 'do not automagically 
calculate frames anymore' mode, and then this problem should go away.

NB: MAXS is another automagic luxury feature and we'll still need that. 
However, from what we understand of the class verifier and how ASM works, this 
will not be a problem.

NB2: This is a theory, as yet untested if this is the actual cause of the 
problem.

Original comment by reini...@gmail.com on 31 Mar 2015 at 12:19

GoogleCodeExporter commented 9 years ago
Current master should have this problem all fixed, including a change in how 
save actions are handled which broke format-on-save, a bug we previously fixed.

We'll get a fix out the door soonish; mars is nearing stable and I'm kinda 
itching to start using it myself because it looks like they did some major work 
on the stability of auto-complete and the like in lambdas.

Original comment by reini...@gmail.com on 5 Apr 2015 at 2:22

GoogleCodeExporter commented 9 years ago
Great, I'll build from master and give it a try and report back. Thanks!

Original comment by ja...@takari.io on 6 Apr 2015 at 2:08

GoogleCodeExporter commented 9 years ago
Can I ask what your configuration looks like? I tried with my custom 
distribution first and that is currently not working so I'll try stock Eclipse 
M6. I assume you tried with stock Eclipse M6?

Thanks!

Original comment by ja...@takari.io on 6 Apr 2015 at 3:10

GoogleCodeExporter commented 9 years ago
Works fine for me in stock Eclipse M6. So the issue is with my distribution but 
thanks for fixing the issue so quickly!

Original comment by ja...@takari.io on 6 Apr 2015 at 3:13

GoogleCodeExporter commented 9 years ago
Is there anything JDT specific that is required to make Lombok work in Eclipse? 
While provisioning my distribution of Eclipse maybe I'm missing something 
required. I'm not seeing any errors in the log, I just see in the IDE that the 
classes are not being instrumented. This is completely my doing with my 
distribution I'm sure.

Original comment by ja...@takari.io on 6 Apr 2015 at 3:24

GoogleCodeExporter commented 9 years ago
I'll also just note that even though I'm using the Eclipse M6 bits, I still 
have the old Luna application layout. Not sure if that might be an issue.

Original comment by ja...@takari.io on 6 Apr 2015 at 3:25