diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-22 01:33:24 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-22 01:33:24 +0200 |
commit | 483e23d3853aa37a19390019fcf0db97ac8bc1d4 (patch) | |
tree | 1794c6fc66136f962ee4c9c6a229e39c0af827e5 /src/core/lombok | |
parent | 59e585a0c68959eb72be34524bdad19df5dc8a4d (diff) | |
download | lombok-483e23d3853aa37a19390019fcf0db97ac8bc1d4.tar.gz lombok-483e23d3853aa37a19390019fcf0db97ac8bc1d4.tar.bz2 lombok-483e23d3853aa37a19390019fcf0db97ac8bc1d4.zip |
Added tests for ecj, fixed a few minor bugs that came out of that.
Diffstat (limited to 'src/core/lombok')
3 files changed, 3 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java index 2142618f..e501c3f1 100644 --- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java @@ -527,6 +527,7 @@ public class HandleEqualsAndHashCode implements EclipseAnnotationHandler<EqualsA /* MyType<?> other = (MyType<?>) o; */ { if (!fields.isEmpty()) { LocalDeclaration other = new LocalDeclaration(otherN, pS, pE); + other.modifiers |= ClassFileConstants.AccFinal; Eclipse.setGeneratedBy(other, source); char[] typeName = typeDecl.name; Expression targetType; diff --git a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java index 20ede725..ee049f1f 100644 --- a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java @@ -412,7 +412,7 @@ public class HandleEqualsAndHashCode implements JavacAnnotationHandler<EqualsAnd } else /* objects */ { /* if (this.fieldName == null ? other.fieldName != null : !this.fieldName.equals(other.fieldName)) return false; */ JCExpression thisEqualsNull = maker.Binary(JCTree.EQ, thisFieldAccessor, maker.Literal(TypeTags.BOT, null)); - JCExpression otherNotEqualsNull = maker.Binary(JCTree.NE, thisFieldAccessor, maker.Literal(TypeTags.BOT, null)); + JCExpression otherNotEqualsNull = maker.Binary(JCTree.NE, otherFieldAccessor, maker.Literal(TypeTags.BOT, null)); JCExpression thisEqualsThat = maker.Apply(List.<JCExpression>nil(), maker.Select(createFieldAccessor(maker, fieldNode, useFieldsDirectly), typeNode.toName("equals")), List.of(createFieldAccessor(maker, fieldNode, useFieldsDirectly, maker.Ident(otherName)))); diff --git a/src/core/lombok/javac/handlers/HandleSneakyThrows.java b/src/core/lombok/javac/handlers/HandleSneakyThrows.java index fda8805c..b2337f67 100644 --- a/src/core/lombok/javac/handlers/HandleSneakyThrows.java +++ b/src/core/lombok/javac/handlers/HandleSneakyThrows.java @@ -102,7 +102,7 @@ public class HandleSneakyThrows implements JavacAnnotationHandler<SneakyThrows> JCExpression varType = chainDots(maker, node, exception.split("\\.")); - JCVariableDecl catchParam = maker.VarDef(maker.Modifiers(0), node.toName("$ex"), varType, null); + JCVariableDecl catchParam = maker.VarDef(maker.Modifiers(Flags.FINAL), node.toName("$ex"), varType, null); JCExpression lombokLombokSneakyThrowNameRef = chainDots(maker, node, "lombok", "Lombok", "sneakyThrow"); JCBlock catchBody = maker.Block(0, List.<JCStatement>of(maker.Throw(maker.Apply( List.<JCExpression>nil(), lombokLombokSneakyThrowNameRef, |