diff options
author | Roel Spilker <r.spilker@gmail.com> | 2010-11-03 02:13:28 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2010-11-03 02:13:28 +0100 |
commit | f6b60b0cae7f8af2e4598f2bbbd72839e193a36b (patch) | |
tree | 1c15415122ce486311b0e33c9f7a438fcf694ec2 /src/core/lombok/javac/handlers/JavacHandlerUtil.java | |
parent | fcf39d88b489d03bc93cecf0e98e7ffbb7a162aa (diff) | |
download | lombok-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.java | 15 |
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 @{@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(); |