From 8ca3ddaa530ca287caff32c2b0dbcff8c17e74c2 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 6 Aug 2012 21:26:55 +0200 Subject: fully tested the HandleWither impl for eclipse. --- src/core/lombok/eclipse/handlers/HandleWither.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/lombok/eclipse/handlers/HandleWither.java b/src/core/lombok/eclipse/handlers/HandleWither.java index 90253ade..7dd93d84 100644 --- a/src/core/lombok/eclipse/handlers/HandleWither.java +++ b/src/core/lombok/eclipse/handlers/HandleWither.java @@ -225,7 +225,7 @@ public class HandleWither extends EclipseAnnotationHandler { if (child.getKind() != Kind.FIELD) continue; FieldDeclaration childDecl = (FieldDeclaration) child.get(); // Skip fields that start with $ - if (childDecl.name.toString().startsWith("$")) continue; + if (childDecl.name != null && childDecl.name.length > 0 && childDecl.name[0] == '$') continue; long fieldFlags = childDecl.modifiers; // Skip static fields. if ((fieldFlags & ClassFileConstants.AccStatic) != 0) continue; @@ -243,8 +243,8 @@ public class HandleWither extends EclipseAnnotationHandler { constructorCall.type = cloneSelfType(fieldNode, source); Expression identityCheck = new EqualExpression( - new SingleNameReference(field.name, p), createFieldAccessor(fieldNode, FieldAccess.ALWAYS_FIELD, source), + new SingleNameReference(field.name, p), OperatorIds.EQUAL_EQUAL); ThisReference thisRef = new ThisReference(pS, pE); Expression conditional = new ConditionalExpression(identityCheck, thisRef, constructorCall); -- cgit