deprecating the old Value annotation also added deprecation warnings to where we still support it as an alias. fixed.

This commit is contained in:
Reinier Zwitserloot committed 2013-06-25 13:03:42 +02:00
1 parent fb32de51af
commit 420e0dcb53
1 file changed
+6 -1
@@ -22,6 +22,9 @@
package lombok.javac.handlers;
import static lombok.javac.handlers.JavacHandlerUtil.*;
import java.lang.annotation.Annotation;
import lombok.AccessLevel;
import lombok.core.AnnotationValues;
import lombok.core.HandlerPriority;
@@ -45,7 +48,9 @@ import com.sun.tools.javac.tree.JCTree.JCModifiers;
@HandlerPriority(-512) //-2^9; to ensure @EqualsAndHashCode and such pick up on this handler making the class final and messing with the fields' access levels, run earlier.
public class HandleValue extends JavacAnnotationHandler<Value> {
@Override public void handle(AnnotationValues<Value> annotation, JCAnnotation ast, JavacNode annotationNode) {
deleteAnnotationIfNeccessary(annotationNode, Value.class, lombok.experimental.Value.class);
@SuppressWarnings("deprecation")
Class<? extends Annotation> oldExperimentalValue = lombok.experimental.Value.class;
deleteAnnotationIfNeccessary(annotationNode, Value.class, oldExperimentalValue);
JavacNode typeNode = annotationNode.up();
boolean notAClass = !isClass(typeNode);