_Migrated from Google Code (issue 837)_
:bust_in_silhouette: uli.quill :clock8: Jul 08, 2015 at 12:11 UTC
Both, the current stable and unstable versions of lombok (1.16.4 , 1.16.5) introduce various problems with Eclipse's code generation features.
Many of Eclipse's code generation features, e.g. (but not limited to) "generate getters + setters", "extract interface", generate new class with "main"-method, run clean-up etc., do not work anymore.
Instead of completing the operation, an "internal error" is raised.
The exact error message (index and range) varies a bit, but it always comes down to this stacktrace:
Caused by: java.lang.IndexOutOfBoundsException: Index: 8, Size: 8
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at org.eclipse.jdt.internal.formatter.TokenManager.get(TokenManager.java:68)
at org.eclipse.jdt.internal.formatter.TokenManager.findIndex(TokenManager.java:161)
at org.eclipse.jdt.internal.formatter.TokenManager.firstIndexIn(TokenManager.java:188)
at org.eclipse.jdt.internal.formatter.TokenManager.firstTokenIn(TokenManager.java:194)
at org.eclipse.jdt.internal.formatter.SpacePreparator.visit(SpacePreparator.java:196)
at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:611)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:470)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareSpaces(DefaultCodeFormatter.java:350)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareFormattedCode(DefaultCodeFormatter.java:193)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:155)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:139)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatString(ASTRewriteFormatter.java:246)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatNode(ASTRewriteFormatter.java:376)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.getFormattedResult(ASTRewriteFormatter.java:187)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doTextInsert(ASTRewriteAnalyzer.java:1357)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:647)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:553)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteNodeList(ASTRewriteAnalyzer.java:1243)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1804)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:453)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:302)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:291)
at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.attachChange(CompilationUnitRewrite.java:278)
at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.createChange(CompilationUnitRewrite.java:241)
at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.createChange(CompilationUnitRewrite.java:225)
at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.createChange(CompilationUnitRewrite.java:192)
at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.createChangeManager(ExtractInterfaceProcessor.java:424)
at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.checkFinalConditions(ExtractInterfaceProcessor.java:245)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:224)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
What version of the product are you using? On what operating system?
Eclipse 4.5 Mars 64bit
JDK 1.8.45 64bit
Windows 7 64bit
:bust_in_silhouette: bogusandre :clock8: Jul 09, 2015 at 06:45 UTC
I also encounter internal errors on Eclipse 4.5 Mars 64bit using JDK 1.8.0_45 64bit, but on Linux. Restarting Eclipse seems to make them go away for some time.
I get:
Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
With the following stacktrace:
java.lang.LinkageError: lombok/launch/PatchFixesHider$PatchFixes
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.addUsage(OccurrencesFinder.java)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:150)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:168)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
at org.eclipse.jdt.core.dom.PackageDeclaration.accept0(PackageDeclaration.java:225)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:210)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.performSearch(OccurrencesFinder.java:100)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.getOccurrences(OccurrencesFinder.java:105)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:3361)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$ActivationListener.windowActivated(JavaEditor.java:1267)
at org.eclipse.ui.internal.Workbench$11.run(Workbench.java:1039)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench.fireWindowActivated(Workbench.java:1036)
at org.eclipse.ui.internal.WorkbenchWindow$15.shellActivated(WorkbenchWindow.java:2284)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:88)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1327)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1351)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1332)
at org.eclipse.swt.widgets.Shell.gtk_focus_in_event(Shell.java:1365)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1963)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:5590)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4717)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9272)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1225)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2422)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
:bust_in_silhouette: zilvar.tomas :clock8: Jul 09, 2015 at 13:45 UTC
Indeed, Eclipse Mars (and consequently Spring Tool Suite 3.7.0-RELEASE) have multiple issues caused by this ArrayIndexOutOfBoundsException (the exact numbers differ, but the cause will most likely be the same).
See https://issuetracker.springsource.com/browse/STS-4180 or https://issuetracker.springsource.com/browse/STS-4182 for use cases where Lombok causes these
:bust_in_silhouette: pierre.poissinger :clock8: Jul 10, 2015 at 13:06 UTC
Master branch at 75647ee2dfec929719ddbd58fdd0b10006309fab seems to fix my Mars issues.
:bust_in_silhouette: bogusandre :clock8: Jul 14, 2015 at 09:29 UTC
@ pierre: Your link is broken.
:bust_in_silhouette: pierre.poissinger :clock8: Jul 14, 2015 at 10:18 UTC
That's was just the top hash of master I used... and looks like Google code tries to be too smart
Github links:
https://github.com/rzwitserloot/lombok/commit/75647ee2dfec929719ddbd58fdd0b10006309fab / https://github.com/rzwitserloot/lombok/tree/75647ee2dfec929719ddbd58fdd0b10006309fab
[That's currently the top of master]
_End of migration_
Before i start building me an ant dev environment, is there some kind of nightly builds?
I tried to build a current lombok-master branch on 15. 7. and it has indeed resolved the issues. I can share the JAR on my Google Drive if anyone is interested, it's just a regular ant build of lombok-1.16.5-SNAPSHOT... https://drive.google.com/file/d/0B_fqmZtODWL9MnRZcGZ5NC00amM/view?usp=sharing
@ZiziTheFirst your Jar seem to work for me as well. Phew. Thx for now.
What's the roadmap for the upcoming 1.16.x release? The milestones don't seem to be up to date. Is there an ETA?
@ZiziTheFirst your jar solves the problem. Thx!
I just use ubuntu 14.04 64bit & eclipse mars jdk1.7,but lombok doesn't work at all. I put the @Data annotation on my own class and not see the accessors occurs. so as other annotations too.
Lombok v1.16.6 has just been released and contains several Mars fixes. Can you please verify if this version still contains the problem?
That's great news! I just gave it a spin and indeed I can see the code completion working again. Thanks!
Lombok v 1.16.6 works fine in the problematic cases mentioned - JUnit4 test generation + Generate getters and setters do their job with no errors or warnings. Thanks for the fixes & release!
Here's a problem. When I use Lombok v1.16.6 with ExtensionMethod, there's no content assist.
e.g.
@ExtensionMethod(java.util.Arrays.class)
class Example {
private void example() {
long[] values = new long[] { 2, 5, 7, 9 };
values.copyOf(3).sort();
}
}
When I press "values.", there's no content assist.
@riderarcher Can you please file a new bug report for your findings?
I still have those Errors with 1.16.6. Also some other strange bugs... (Add throws to method, Moreunit create test is empty, create class wizard with main-class Checkbox results in error...).
Eclipse-Mars: 4.5.1, Gradle-Dependency: compile 'org.projectlombok:lombok:1.16.6'
We have the same problem with Eclipse-Mars: 4.5.0 with lombok 1.16.6 when we do save. We have some save on actions
Same here- several wizards don't work.
Eclipse-Mars: 4.5.1, Gradle-Dependency: compile 'org.projectlombok:lombok:1.16.6'
Same issues here.
A save participant caused problems.
The save participant 'Code Clean Up' caused an exception: java.lang.ArrayIndexOutOfBoundsException. See the error log for details.
... and then the log isn't useful:
!ENTRY org.eclipse.jdt.ui 4 10006 2016-01-18 11:56:27.178
!MESSAGE The save participant 'org.eclipse.jdt.ui.postsavelistener.cleanup' caused an exception: java.lang.ArrayIndexOutOfBoundsException
!STACK 0
java.lang.ArrayIndexOutOfBoundsException
Lombok 1.16.6 with Mars 4.5.1
Same as previous here
Lombok 1.16.6 with Mars 4.5.1
I'm also still seeing this error with latest Lombok and latest Mars releases.
Whenever I remove the Lombok annotations, Eclipse Save-actions works just fine without error.
same as @michelbetancourt for me
From another thread:
In experimenting with it, the save action setting Format source code > Format edited lines toggles whether it happens. With it enabled, it won't happen if I add and remove a space, but it will happen if I add a new field to the class or even a new comment/new token.
@rspilker - can you re-open this please. Sufficient users are having issues that it is still a problem. I think the difference between it working for some users and not for others is the "Format edited lines" toggle in the Java save actions.
Problem still present with 1.16.8
i am also waiting a fix. Problem still present.
The problem is still present with Eclipse Neon and Lombok 1.16.8. It appears to be caused by the "Format edited lines" save action.
Yes, same here - confirming - "Format edited lines" is the cause.
Problem still present with 1.16.10 on neon
Problem still present with 1.16.10 on neon, should we open a new issue?
Has been logged under #879