From aa8a627349bb68f376b98847b6f73c2c89e989fd Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 30 May 2011 22:04:46 +0200 Subject: tracking if an annotation has been handled or not is now no longer done via the LombokAST object. Instead its tracked more directly in an attempt to avoid having to write all handlers as idempotent, and just in case issue #164 is a race condition (the handled-or-not is a synchronized CAS check). This does break API for other plugins, but the fix is trivial: Just make your 'handle' method return void. That 'we won't call you again' business in the decks never quite worked right anyway. Also, you might want to call Javac.(recursive)setHandledBy when you generate nodes, now. --- src/core/lombok/eclipse/handlers/HandleData.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/core/lombok/eclipse/handlers/HandleData.java') diff --git a/src/core/lombok/eclipse/handlers/HandleData.java b/src/core/lombok/eclipse/handlers/HandleData.java index 0a28ccf4..9b3d7e51 100644 --- a/src/core/lombok/eclipse/handlers/HandleData.java +++ b/src/core/lombok/eclipse/handlers/HandleData.java @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2010 Reinier Zwitserloot and Roel Spilker. + * Copyright © 2009-2011 Reinier Zwitserloot and Roel Spilker. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ import org.mangosdk.spi.ProviderFor; */ @ProviderFor(EclipseAnnotationHandler.class) public class HandleData implements EclipseAnnotationHandler { - public boolean handle(AnnotationValues annotation, Annotation ast, EclipseNode annotationNode) { + public void handle(AnnotationValues annotation, Annotation ast, EclipseNode annotationNode) { Data ann = annotation.getInstance(); EclipseNode typeNode = annotationNode.up(); @@ -49,7 +49,7 @@ public class HandleData implements EclipseAnnotationHandler { if (typeDecl == null || notAClass) { annotationNode.addError("@Data is only supported on a class."); - return false; + return; } //Careful: Generate the public static constructor (if there is one) LAST, so that any attempt to @@ -63,7 +63,5 @@ public class HandleData implements EclipseAnnotationHandler { new HandleEqualsAndHashCode().generateEqualsAndHashCodeForType(typeNode, annotationNode); new HandleToString().generateToStringForType(typeNode, annotationNode); new HandleConstructor().generateRequiredArgsConstructor(typeNode, AccessLevel.PUBLIC, ann.staticConstructor(), true, ast); - - return false; } } -- cgit