diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-12-04 07:14:05 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-12-11 22:40:48 +0100 |
commit | 7e21683515144cc6127eff007226c86021b7b2df (patch) | |
tree | 2132f4af507afbc5c785bb392c2d3fdbb02e812d /src/core/lombok/javac/handlers/JavacHandlerUtil.java | |
parent | 9639bc2ff466e94f629d81ff00d8cab654f3ab19 (diff) | |
download | lombok-7e21683515144cc6127eff007226c86021b7b2df.tar.gz lombok-7e21683515144cc6127eff007226c86021b7b2df.tar.bz2 lombok-7e21683515144cc6127eff007226c86021b7b2df.zip |
Added format preferences: Suppress @SuppressWarnings, suppress needless application of 'final'.
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacHandlerUtil.java')
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index d61174ae..8a125fb6 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -43,6 +43,7 @@ import lombok.core.AnnotationValues; import lombok.core.AnnotationValues.AnnotationValue; import lombok.core.TransformationsUtil; import lombok.core.TypeResolver; +import lombok.delombok.LombokOptionsFactory; import lombok.experimental.Accessors; import lombok.javac.Javac; import lombok.javac.JavacNode; @@ -892,7 +893,15 @@ public class JavacHandlerUtil { return typeNode.add(type, Kind.TYPE); } + public static long addFinalIfNeeded(long flags, Context context) { + boolean addFinal = LombokOptionsFactory.getDelombokOptions(context).getFormatPreferences().generateFinalParams(); + + if (addFinal) flags |= Flags.FINAL; + return flags; + } + private static void addSuppressWarningsAll(JCModifiers mods, JavacNode node, int pos, JCTree source, Context context) { + if (!LombokOptionsFactory.getDelombokOptions(context).getFormatPreferences().generateSuppressWarnings()) return; JavacTreeMaker maker = node.getTreeMaker(); JCExpression suppressWarningsType = chainDots(node, "java", "lang", "SuppressWarnings"); JCLiteral allLiteral = maker.Literal("all"); |