Open GoogleCodeExporter opened 9 years ago
Yes, we need more information. I just downloaded 4.4M7 and installed lombok.
I cannot reproduce the problem. Is there any specific lombok feature that
triggers this bug? Can you reproduce it in a new workspace?
The following code compiles without any problems:
package test;
import lombok.Data;
@Data
public class Foo {
int x;
}
Original comment by r.spilker
on 20 May 2014 at 10:41
Wait, is this a duplicate of issue 677?
Original comment by r.spilker
on 20 May 2014 at 10:42
I doubt if it is a duplicate of 677, may have the same cause though.
Thanks for your effort and pointers, I'll try to reproduce it in a clean
workspace and project. You are welcome to park this until I do. thanks.
Original comment by ama...@gmail.com
on 20 May 2014 at 11:01
I think it's possible to reproduce with save action "Organize imports" and
using @Delegate annotation.
Enable "Save Actions" (I did it for the whole workspace):
- Uncheck Formatting
- Check Organize imports
- Uncheck additional actions
Try the following code snippet:
public class BaseClass {
//@Delegate
private List<String> field;
}
Uncomment the annotation and save again. This causes the above exception to
appear.
Original comment by rgransbe...@gmx.de
on 3 Jun 2014 at 8:14
On eclipse luna 4.4.0 and lombok 1.14.0, I reproduce this issue by following
code:
import lombok.val;
public class ValWithArray {
void f() {
val a = "a,b,c".split(",");
}
}
Stacktrace:
java.lang.IllegalArgumentException: startPos = 62 and length is -62.
This breaks the rule that lengths are not allowed to be negative. Affected Node:
java.lang.String[]
at lombok.eclipse.agent.PatchDiagnostics.setSourceRangeCheck(PatchDiagnostics.java:33)
at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java)
at org.eclipse.jdt.core.dom.ASTConverter.setTypeAnnotationsAndSourceRangeOnArray(ASTConverter.java:3420)
at org.eclipse.jdt.core.dom.ASTConverter.convertToArray(ASTConverter.java:3166)
at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3831)
at org.eclipse.jdt.core.dom.ASTConverter.convertToVariableDeclarationStatement(ASTConverter.java:3439)
at org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleLocalDeclaration(ASTConverter.java:458)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:633)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:195)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2958)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1374)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:292)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1209)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:809)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:544)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:537)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:480)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:128)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:170)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Original comment by buzz.ta...@gmail.com
on 22 Aug 2014 at 3:06
> On eclipse luna 4.4.0 and lombok 1.14.0, I reproduce this issue by following
code:
Sorry, I reproduce it using lombok 1.14.4, not lombok 1.14.0.
Original comment by buzz.ta...@gmail.com
on 22 Aug 2014 at 3:09
Hi,
I finally tried upgrading to luna again and hit this again with Lombok 1.14.6 :(
Yes I can reproduce this with a simple:
public class StringBuilderUtil {
//@Delegate
private StringBuilder sb = new StringBuilder();
}
thanks rgransbe... !
But since @Delegate has been demoted :( , I suppose this is a won't fix..
===
java.lang.IllegalArgumentException: startPos = 165 and length is -165.
This breaks the rule that lengths are not allowed to be negative. Affected Node:
char[]
at lombok.eclipse.agent.PatchDiagnostics.setSourceRangeCheck(PatchDiagnostics.java:33)
at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java)
at org.eclipse.jdt.core.dom.ASTConverter.setTypeAnnotationsAndSourceRangeOnArray(ASTConverter.java:3420)
at org.eclipse.jdt.core.dom.ASTConverter.convertToArray(ASTConverter.java:3166)
at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3628)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:921)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:550)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:195)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2958)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1374)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:292)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1209)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:809)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:544)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:537)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:480)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:128)
at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:161)
at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:136)
at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:273)
at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:273)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:83)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:367)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:349)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:372)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:332)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
===
With buzz.ta...'s ValWithArray I just get the error in the logs (no annoying
popup yet):
===
java.lang.IllegalArgumentException: startPos = 104 and length is -104.
This breaks the rule that lengths are not allowed to be negative. Affected Node:
java.lang.String[]
at lombok.eclipse.agent.PatchDiagnostics.setSourceRangeCheck(PatchDiagnostics.java:33)
at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java)
at org.eclipse.jdt.core.dom.ASTConverter.setTypeAnnotationsAndSourceRangeOnArray(ASTConverter.java:3420)
at org.eclipse.jdt.core.dom.ASTConverter.convertToArray(ASTConverter.java:3166)
at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3831)
at org.eclipse.jdt.core.dom.ASTConverter.convertToVariableDeclarationStatement(ASTConverter.java:3439)
at org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleLocalDeclaration(ASTConverter.java:458)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:633)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:195)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2958)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1374)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:292)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1209)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:809)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:544)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:537)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:480)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:470)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:470)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:128)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:170)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
===
Original comment by ama...@gmail.com
on 15 Sep 2014 at 10:07
This affects val too.
Original comment by christia...@gmail.com
on 17 Sep 2014 at 11:38
Especially when using breakpoints.
Original comment by christia...@gmail.com
on 17 Sep 2014 at 11:39
I am encoutering the same issue, with 1.14.8 like when in eclipse lune doing a
refactoring, extract to method:
java.lang.IllegalArgumentException: startPos = 1143 and length is -1143.
This breaks the rule that lengths are not allowed to be negative. Affected Node:
java.lang.String[]
at lombok.eclipse.agent.PatchDiagnostics.setSourceRangeCheck(PatchDiagnostics.java:33)
at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java)
at org.eclipse.jdt.core.dom.ASTConverter.setTypeAnnotationsAndSourceRangeOnArray(ASTConverter.java:3420)
at org.eclipse.jdt.core.dom.ASTConverter.convertToArray(ASTConverter.java:3166)
at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3831)
at org.eclipse.jdt.core.dom.ASTConverter.convertToVariableDeclarationStatement(ASTConverter.java:3439)
at org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleLocalDeclaration(ASTConverter.java:458)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1257)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2681)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1948)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2705)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1259)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2681)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1886)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2671)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1259)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2681)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1948)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2705)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:635)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:195)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2958)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1374)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:292)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1209)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:809)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:544)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:537)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:480)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:128)
at org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser.parseWithASTProvider(RefactoringASTParser.java:119)
at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkInitialConditions(ExtractTempRefactoring.java:580)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Original comment by Michel.L...@gmail.com
on 15 Oct 2014 at 1:20
I can confirm that the problem also exists in the newest version of eclipse:
Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
with
Lombok 1.16.4.
It's enough to use some of the save actions and @val in a file:
A save participant caused problems:
The save participant 'Code Clean Up' caused an exception:
java.lang.IllegalArgumentException: startPos = 4873 and length is -4873.
This breaks the rule that lengths are not allowed to be negative. Affected Node:
byte[]. See the error log for details.
Original comment by andreas@filler.name
on 23 Jun 2015 at 12:13
Original issue reported on code.google.com by
ama...@gmail.com
on 15 May 2014 at 1:25