aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/JavacHandlerUtil.java
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2010-11-03 02:13:28 +0100
committerRoel Spilker <r.spilker@gmail.com>2010-11-03 02:13:28 +0100
commitf6b60b0cae7f8af2e4598f2bbbd72839e193a36b (patch)
tree1c15415122ce486311b0e33c9f7a438fcf694ec2 /src/core/lombok/javac/handlers/JavacHandlerUtil.java
parentfcf39d88b489d03bc93cecf0e98e7ffbb7a162aa (diff)
downloadlombok-f6b60b0cae7f8af2e4598f2bbbd72839e193a36b.tar.gz
lombok-f6b60b0cae7f8af2e4598f2bbbd72839e193a36b.tar.bz2
lombok-f6b60b0cae7f8af2e4598f2bbbd72839e193a36b.zip
Intial support for @Log, for now only slf4j
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacHandlerUtil.java')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 79436327..3e734f8b 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -392,13 +392,26 @@ public class JavacHandlerUtil {
/**
* Adds the given new field declaration to the provided type AST Node.
+ * The field carries the &#64;{@link SuppressWarnings}("all") annotation.
+ * Also takes care of updating the JavacAST.
+ */
+ public static void injectFieldSuppressWarnings(JavacNode typeNode, JCVariableDecl field) {
+ injectField(typeNode, field, true);
+ }
+
+ /**
+ * Adds the given new field declaration to the provided type AST Node.
*
* Also takes care of updating the JavacAST.
*/
public static void injectField(JavacNode typeNode, JCVariableDecl field) {
+ injectField(typeNode, field, false);
+ }
+
+ private static void injectField(JavacNode typeNode, JCVariableDecl field, boolean addSuppressWarnings) {
JCClassDecl type = (JCClassDecl) typeNode.get();
- addSuppressWarningsAll(field.mods, typeNode, field.pos);
+ if (addSuppressWarnings) addSuppressWarningsAll(field.mods, typeNode, field.pos);
type.defs = type.defs.append(field);
typeNode.add(field, Kind.FIELD).recursiveSetHandled();