aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-12-22 06:03:51 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-01-18 18:55:53 +0100
commite24ebbbf598adff2c8919dccce6e10b20021494e (patch)
tree4b50c7eef5408c86ef0f35000a2005b5252dfee0 /src/core/lombok/eclipse
parent3797c8320acd903d3a5b6ce5c1ad97917df65f0a (diff)
downloadlombok-e24ebbbf598adff2c8919dccce6e10b20021494e.tar.gz
lombok-e24ebbbf598adff2c8919dccce6e10b20021494e.tar.bz2
lombok-e24ebbbf598adff2c8919dccce6e10b20021494e.zip
[configuration] implementation of flagUsage for all handlers.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleBuilder.java2
-rw-r--r--src/core/lombok/eclipse/handlers/HandleCleanup.java3
-rw-r--r--src/core/lombok/eclipse/handlers/HandleConstructor.java8
-rw-r--r--src/core/lombok/eclipse/handlers/HandleData.java4
-rw-r--r--src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java4
-rw-r--r--src/core/lombok/eclipse/handlers/HandleExtensionMethod.java6
-rw-r--r--src/core/lombok/eclipse/handlers/HandleFieldDefaults.java3
-rw-r--r--src/core/lombok/eclipse/handlers/HandleGetter.java3
-rw-r--r--src/core/lombok/eclipse/handlers/HandleLog.java15
-rw-r--r--src/core/lombok/eclipse/handlers/HandleNonNull.java3
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSetter.java3
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSneakyThrows.java5
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSynchronized.java5
-rw-r--r--src/core/lombok/eclipse/handlers/HandleToString.java5
-rw-r--r--src/core/lombok/eclipse/handlers/HandleVal.java5
-rw-r--r--src/core/lombok/eclipse/handlers/HandleValue.java3
-rw-r--r--src/core/lombok/eclipse/handlers/HandleWither.java3
17 files changed, 74 insertions, 6 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java
index 981d77dc..7aa740a4 100644
--- a/src/core/lombok/eclipse/handlers/HandleBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java
@@ -71,6 +71,8 @@ import lombok.experimental.NonFinal;
@HandlerPriority(-1024) //-2^10; to ensure we've picked up @FieldDefault's changes (-2048) but @Value hasn't removed itself yet (-512), so that we can error on presence of it on the builder classes.
public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
@Override public void handle(AnnotationValues<Builder> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Builder.FLAG_USAGE, "@Builder");
+
long p = (long) ast.sourceStart << 32 | ast.sourceEnd;
Builder builderInstance = annotation.getInstance();
diff --git a/src/core/lombok/eclipse/handlers/HandleCleanup.java b/src/core/lombok/eclipse/handlers/HandleCleanup.java
index cbf84e8b..13d517d5 100644
--- a/src/core/lombok/eclipse/handlers/HandleCleanup.java
+++ b/src/core/lombok/eclipse/handlers/HandleCleanup.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.util.Arrays;
@@ -58,6 +59,8 @@ import org.mangosdk.spi.ProviderFor;
@ProviderFor(EclipseAnnotationHandler.class)
public class HandleCleanup extends EclipseAnnotationHandler<Cleanup> {
public void handle(AnnotationValues<Cleanup> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Cleanup.FLAG_USAGE, "@Cleanup");
+
String cleanupName = annotation.getInstance().value();
if (cleanupName.length() == 0) {
annotationNode.addError("cleanupName cannot be the empty string.");
diff --git a/src/core/lombok/eclipse/handlers/HandleConstructor.java b/src/core/lombok/eclipse/handlers/HandleConstructor.java
index 22285b2d..782c85df 100644
--- a/src/core/lombok/eclipse/handlers/HandleConstructor.java
+++ b/src/core/lombok/eclipse/handlers/HandleConstructor.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.Eclipse.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
@@ -32,6 +33,7 @@ import java.util.List;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
+import lombok.ConfigurationKeys;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.core.AST.Kind;
@@ -69,6 +71,8 @@ public class HandleConstructor {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleNoArgsConstructor extends EclipseAnnotationHandler<NoArgsConstructor> {
@Override public void handle(AnnotationValues<NoArgsConstructor> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, NoArgsConstructor.FLAG_USAGE, "@NoArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor");
+
EclipseNode typeNode = annotationNode.up();
if (!checkLegality(typeNode, annotationNode, NoArgsConstructor.class.getSimpleName())) return;
NoArgsConstructor ann = annotation.getInstance();
@@ -86,6 +90,8 @@ public class HandleConstructor {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleRequiredArgsConstructor extends EclipseAnnotationHandler<RequiredArgsConstructor> {
@Override public void handle(AnnotationValues<RequiredArgsConstructor> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, RequiredArgsConstructor.FLAG_USAGE, "@RequiredArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor");
+
EclipseNode typeNode = annotationNode.up();
if (!checkLegality(typeNode, annotationNode, RequiredArgsConstructor.class.getSimpleName())) return;
RequiredArgsConstructor ann = annotation.getInstance();
@@ -132,6 +138,8 @@ public class HandleConstructor {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleAllArgsConstructor extends EclipseAnnotationHandler<AllArgsConstructor> {
@Override public void handle(AnnotationValues<AllArgsConstructor> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, AllArgsConstructor.FLAG_USAGE, "@AllArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor");
+
EclipseNode typeNode = annotationNode.up();
if (!checkLegality(typeNode, annotationNode, AllArgsConstructor.class.getSimpleName())) return;
AllArgsConstructor ann = annotation.getInstance();
diff --git a/src/core/lombok/eclipse/handlers/HandleData.java b/src/core/lombok/eclipse/handlers/HandleData.java
index aa309489..ed7c0ce2 100644
--- a/src/core/lombok/eclipse/handlers/HandleData.java
+++ b/src/core/lombok/eclipse/handlers/HandleData.java
@@ -21,6 +21,8 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
+
import java.util.Collections;
import lombok.AccessLevel;
@@ -41,6 +43,8 @@ import org.mangosdk.spi.ProviderFor;
@ProviderFor(EclipseAnnotationHandler.class)
public class HandleData extends EclipseAnnotationHandler<Data> {
public void handle(AnnotationValues<Data> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Data.FLAG_USAGE, "@Data");
+
Data ann = annotation.getInstance();
EclipseNode typeNode = annotationNode.up();
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
index 3c8a7039..295646fd 100644
--- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
+++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.lang.reflect.Modifier;
@@ -118,6 +119,9 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH
@Override public void handle(AnnotationValues<EqualsAndHashCode> annotation,
Annotation ast, EclipseNode annotationNode) {
+
+ handleFlagUsage(annotationNode, EqualsAndHashCode.FLAG_USAGE, "@EqualsAndHashCode");
+
EqualsAndHashCode ann = annotation.getInstance();
List<String> excludes = Arrays.asList(ann.exclude());
List<String> includes = Arrays.asList(ann.of());
diff --git a/src/core/lombok/eclipse/handlers/HandleExtensionMethod.java b/src/core/lombok/eclipse/handlers/HandleExtensionMethod.java
index 3d30e8fe..1c483aa0 100644
--- a/src/core/lombok/eclipse/handlers/HandleExtensionMethod.java
+++ b/src/core/lombok/eclipse/handlers/HandleExtensionMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 The Project Lombok Authors.
+ * Copyright (C) 2012-2013 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,6 +21,8 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
+
import java.util.List;
import org.eclipse.jdt.internal.compiler.ast.Annotation;
@@ -39,6 +41,8 @@ import lombok.experimental.ExtensionMethod;
@HandlerPriority(66560) // 2^16 + 2^10; we must run AFTER HandleVal which is at 2^16
public class HandleExtensionMethod extends EclipseAnnotationHandler<ExtensionMethod> {
@Override public void handle(AnnotationValues<ExtensionMethod> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, ExtensionMethod.FLAG_USAGE, "@ExtensionMethod");
+
TypeDeclaration typeDecl = null;
EclipseNode owner = annotationNode.up();
if (owner.get() instanceof TypeDeclaration) typeDecl = (TypeDeclaration) owner.get();
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java
index d6d839cc..89c5b72f 100644
--- a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java
+++ b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import lombok.AccessLevel;
import lombok.core.AST.Kind;
@@ -102,6 +103,8 @@ public class HandleFieldDefaults extends EclipseAnnotationHandler<FieldDefaults>
}
public void handle(AnnotationValues<FieldDefaults> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, FieldDefaults.FLAG_USAGE, "@FieldDefaults");
+
EclipseNode node = annotationNode.up();
FieldDefaults instance = annotation.getInstance();
AccessLevel level = instance.level();
diff --git a/src/core/lombok/eclipse/handlers/HandleGetter.java b/src/core/lombok/eclipse/handlers/HandleGetter.java
index 787f6f6c..21f89fed 100644
--- a/src/core/lombok/eclipse/handlers/HandleGetter.java
+++ b/src/core/lombok/eclipse/handlers/HandleGetter.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.Eclipse.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
@@ -132,6 +133,8 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> {
}
public void handle(AnnotationValues<Getter> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Getter.FLAG_USAGE, "@Getter");
+
EclipseNode node = annotationNode.up();
Getter annotationInstance = annotation.getInstance();
AccessLevel level = annotationInstance.value();
diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java
index 8c09237e..5da82051 100644
--- a/src/core/lombok/eclipse/handlers/HandleLog.java
+++ b/src/core/lombok/eclipse/handlers/HandleLog.java
@@ -21,12 +21,14 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.Eclipse.fromQualifiedName;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.lang.reflect.Modifier;
import java.util.Arrays;
+import lombok.ConfigurationKeys;
import lombok.core.AnnotationValues;
import lombok.core.configuration.ConfigurationKey;
import lombok.eclipse.EclipseAnnotationHandler;
@@ -46,7 +48,6 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.mangosdk.spi.ProviderFor;
public class HandleLog {
-
private static final ConfigurationKey<String> LOG_VARIABLE_NAME = new ConfigurationKey<String>("lombok.log.varName"){};
private static final ConfigurationKey<Boolean> STATIC = new ConfigurationKey<Boolean>("lombok.log.static"){};
@@ -167,6 +168,8 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleCommonsLog extends EclipseAnnotationHandler<lombok.extern.apachecommons.CommonsLog> {
@Override public void handle(AnnotationValues<lombok.extern.apachecommons.CommonsLog> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, lombok.extern.apachecommons.CommonsLog.FLAG_USAGE, "@apachecommons.CommonsLog", ConfigurationKeys.ANY_LOG_FLAG_USAGE, "any @Log");
+
processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode);
}
}
@@ -177,6 +180,8 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleJulLog extends EclipseAnnotationHandler<lombok.extern.java.Log> {
@Override public void handle(AnnotationValues<lombok.extern.java.Log> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, lombok.extern.java.Log.FLAG_USAGE, "@java.Log", ConfigurationKeys.ANY_LOG_FLAG_USAGE, "any @Log");
+
processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode);
}
}
@@ -187,6 +192,8 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleLog4jLog extends EclipseAnnotationHandler<lombok.extern.log4j.Log4j> {
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, lombok.extern.log4j.Log4j.FLAG_USAGE, "@Log4j", ConfigurationKeys.ANY_LOG_FLAG_USAGE, "any @Log");
+
processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode);
}
}
@@ -197,6 +204,8 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleLog4j2Log extends EclipseAnnotationHandler<lombok.extern.log4j.Log4j2> {
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j2> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, lombok.extern.log4j.Log4j2.FLAG_USAGE, "@Log4j2", ConfigurationKeys.ANY_LOG_FLAG_USAGE, "any @Log");
+
processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode);
}
}
@@ -207,6 +216,8 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleSlf4jLog extends EclipseAnnotationHandler<lombok.extern.slf4j.Slf4j> {
@Override public void handle(AnnotationValues<lombok.extern.slf4j.Slf4j> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, lombok.extern.slf4j.Slf4j.FLAG_USAGE, "@Slf4j", ConfigurationKeys.ANY_LOG_FLAG_USAGE, "any @Log");
+
processAnnotation(LoggingFramework.SLF4J, annotation, source, annotationNode);
}
}
@@ -217,6 +228,8 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleXSlf4jLog extends EclipseAnnotationHandler<lombok.extern.slf4j.XSlf4j> {
@Override public void handle(AnnotationValues<lombok.extern.slf4j.XSlf4j> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, lombok.extern.slf4j.XSlf4j.FLAG_USAGE, "@XSlf4j", ConfigurationKeys.ANY_LOG_FLAG_USAGE, "any @Log");
+
processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode);
}
}
diff --git a/src/core/lombok/eclipse/handlers/HandleNonNull.java b/src/core/lombok/eclipse/handlers/HandleNonNull.java
index 634cb2d9..b255d4e1 100644
--- a/src/core/lombok/eclipse/handlers/HandleNonNull.java
+++ b/src/core/lombok/eclipse/handlers/HandleNonNull.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.Eclipse.isPrimitive;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
@@ -57,6 +58,8 @@ import org.mangosdk.spi.ProviderFor;
@HandlerPriority(value = 512) // 2^9; onParameter=@__(@NonNull) has to run first.
public class HandleNonNull extends EclipseAnnotationHandler<NonNull> {
@Override public void handle(AnnotationValues<NonNull> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, NonNull.FLAG_USAGE, "@NonNull");
+
if (annotationNode.up().getKind() == Kind.FIELD) {
// This is meaningless unless the field is used to generate a method (@Setter, @RequiredArgsConstructor, etc),
// but in that case those handlers will take care of it. However, we DO check if the annotation is applied to
diff --git a/src/core/lombok/eclipse/handlers/HandleSetter.java b/src/core/lombok/eclipse/handlers/HandleSetter.java
index 3bfcc51c..1009492a 100644
--- a/src/core/lombok/eclipse/handlers/HandleSetter.java
+++ b/src/core/lombok/eclipse/handlers/HandleSetter.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.Eclipse.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
@@ -118,6 +119,8 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
}
public void handle(AnnotationValues<Setter> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Setter.FLAG_USAGE, "@Setter");
+
EclipseNode node = annotationNode.up();
AccessLevel level = annotation.getInstance().value();
if (level == AccessLevel.NONE || node == null) return;
diff --git a/src/core/lombok/eclipse/handlers/HandleSneakyThrows.java b/src/core/lombok/eclipse/handlers/HandleSneakyThrows.java
index d3a95db8..ec9acfa1 100644
--- a/src/core/lombok/eclipse/handlers/HandleSneakyThrows.java
+++ b/src/core/lombok/eclipse/handlers/HandleSneakyThrows.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.lang.reflect.Modifier;
@@ -75,6 +76,8 @@ public class HandleSneakyThrows extends EclipseAnnotationHandler<SneakyThrows> {
}
@Override public void handle(AnnotationValues<SneakyThrows> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, SneakyThrows.FLAG_USAGE, "@SneakyThrows");
+
List<String> exceptionNames = annotation.getRawExpressions("value");
List<DeclaredException> exceptions = new ArrayList<DeclaredException>();
diff --git a/src/core/lombok/eclipse/handlers/HandleSynchronized.java b/src/core/lombok/eclipse/handlers/HandleSynchronized.java
index f76f06ed..fa0b4ad0 100644
--- a/src/core/lombok/eclipse/handlers/HandleSynchronized.java
+++ b/src/core/lombok/eclipse/handlers/HandleSynchronized.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.lang.reflect.Modifier;
@@ -105,6 +106,8 @@ public class HandleSynchronized extends EclipseAnnotationHandler<Synchronized> {
}
@Override public void handle(AnnotationValues<Synchronized> annotation, Annotation source, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Synchronized.FLAG_USAGE, "@Synchronized");
+
int p1 = source.sourceStart -1;
int p2 = source.sourceStart -2;
long pos = (((long)p1) << 32) | p2;
diff --git a/src/core/lombok/eclipse/handlers/HandleToString.java b/src/core/lombok/eclipse/handlers/HandleToString.java
index 1193af31..deede986 100644
--- a/src/core/lombok/eclipse/handlers/HandleToString.java
+++ b/src/core/lombok/eclipse/handlers/HandleToString.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2012 The Project Lombok Authors.
+ * Copyright (C) 2009-2013 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.util.ArrayList;
@@ -94,6 +95,8 @@ public class HandleToString extends EclipseAnnotationHandler<ToString> {
}
public void handle(AnnotationValues<ToString> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, ToString.FLAG_USAGE, "@ToString");
+
ToString ann = annotation.getInstance();
List<String> excludes = Arrays.asList(ann.exclude());
List<String> includes = Arrays.asList(ann.of());
diff --git a/src/core/lombok/eclipse/handlers/HandleVal.java b/src/core/lombok/eclipse/handlers/HandleVal.java
index e7849952..fbb11d7e 100644
--- a/src/core/lombok/eclipse/handlers/HandleVal.java
+++ b/src/core/lombok/eclipse/handlers/HandleVal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 The Project Lombok Authors.
+ * Copyright (C) 2010-2013 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import lombok.val;
import lombok.core.HandlerPriority;
import lombok.eclipse.DeferUntilPostDiet;
@@ -43,6 +44,8 @@ import org.mangosdk.spi.ProviderFor;
public class HandleVal extends EclipseASTAdapter {
@Override public void visitLocal(EclipseNode localNode, LocalDeclaration local) {
if (!EclipseHandlerUtil.typeMatches(val.class, localNode, local.type)) return;
+ handleFlagUsage(localNode, val.FLAG_USAGE, "val");
+
boolean variableOfForEach = false;
if (localNode.directUp().get() instanceof ForeachStatement) {
diff --git a/src/core/lombok/eclipse/handlers/HandleValue.java b/src/core/lombok/eclipse/handlers/HandleValue.java
index 0607137b..af3b1e8f 100644
--- a/src/core/lombok/eclipse/handlers/HandleValue.java
+++ b/src/core/lombok/eclipse/handlers/HandleValue.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.util.Collections;
@@ -46,6 +47,8 @@ import org.mangosdk.spi.ProviderFor;
@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 EclipseAnnotationHandler<Value> {
public void handle(AnnotationValues<Value> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Value.FLAG_USAGE, "@Value");
+
Value ann = annotation.getInstance();
EclipseNode typeNode = annotationNode.up();
diff --git a/src/core/lombok/eclipse/handlers/HandleWither.java b/src/core/lombok/eclipse/handlers/HandleWither.java
index 27fbc635..76366c2c 100644
--- a/src/core/lombok/eclipse/handlers/HandleWither.java
+++ b/src/core/lombok/eclipse/handlers/HandleWither.java
@@ -21,6 +21,7 @@
*/
package lombok.eclipse.handlers;
+import static lombok.core.handlers.HandlerUtil.*;
import static lombok.eclipse.Eclipse.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
@@ -120,6 +121,8 @@ public class HandleWither extends EclipseAnnotationHandler<Wither> {
}
@Override public void handle(AnnotationValues<Wither> annotation, Annotation ast, EclipseNode annotationNode) {
+ handleFlagUsage(annotationNode, Wither.FLAG_USAGE, "@Wither");
+
EclipseNode node = annotationNode.up();
AccessLevel level = annotation.getInstance().value();
if (level == AccessLevel.NONE || node == null) return;