diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-30 18:17:00 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-30 18:17:00 +0100 |
commit | e5705f94cd3778a2e0d25060f1e013d0c33bfb90 (patch) | |
tree | 679dac4dce518d253c34f125a573b66aaf167f43 /src/core/lombok/javac | |
parent | 26b2fb5cd6d4d73b270be3787fa876cc1bfe80f2 (diff) | |
download | lombok-e5705f94cd3778a2e0d25060f1e013d0c33bfb90.tar.gz lombok-e5705f94cd3778a2e0d25060f1e013d0c33bfb90.tar.bz2 lombok-e5705f94cd3778a2e0d25060f1e013d0c33bfb90.zip |
* Added config key ‘lombok.addGeneratedAnnotation’.
* Added ‘format’ directive for tests.
* Updates tests to salt in some more format and config keys.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 1 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/JavacSingularsRecipes.java | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index a6bc388a..599a4753 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -956,6 +956,7 @@ public class JavacHandlerUtil { } public static void addGenerated(JCModifiers mods, JavacNode node, int pos, JCTree source, Context context) { + if (Boolean.FALSE.equals(node.getAst().readConfiguration(ConfigurationKeys.ADD_GENERATED_ANNOTATIONS))) return; if (!LombokOptionsFactory.getDelombokOptions(context).getFormatPreferences().generateGenerated()) return; addAnnotation(mods, node, pos, source, context, "javax.annotation.Generated", node.getTreeMaker().Literal("lombok")); } diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index 53e01ebb..7fca01ae 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -231,13 +231,13 @@ public class JavacSingularsRecipes { if (typeArgs != null) for (JCExpression orig : typeArgs) { if (!addExtends) { if (orig.getKind() == Kind.UNBOUNDED_WILDCARD || orig.getKind() == Kind.SUPER_WILDCARD) { - arguments.append(chainDots(node, "java", "lang", "Object")); + arguments.append(genJavaLangTypeRef(node, "Object")); } else if (orig.getKind() == Kind.EXTENDS_WILDCARD) { JCExpression inner; try { inner = (JCExpression) ((JCWildcard) orig).inner; } catch (Exception e) { - inner = chainDots(node, "java", "lang", "Object"); + inner = genJavaLangTypeRef(node, "Object"); } arguments.append(cloneType(maker, inner, source, context)); } else { @@ -259,7 +259,7 @@ public class JavacSingularsRecipes { if (addExtends) { arguments.append(maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null)); } else { - arguments.append(chainDots(node, "java", "lang", "Object")); + arguments.append(genJavaLangTypeRef(node, "Object")); } } @@ -280,16 +280,16 @@ public class JavacSingularsRecipes { protected JCExpression cloneParamType(int index, JavacTreeMaker maker, List<JCExpression> typeArgs, JavacNode builderType, JCTree source) { if (typeArgs == null || typeArgs.size() <= index) { - return chainDots(builderType, "java", "lang", "Object"); + return genJavaLangTypeRef(builderType, "Object"); } else { JCExpression originalType = typeArgs.get(index); if (originalType.getKind() == Kind.UNBOUNDED_WILDCARD || originalType.getKind() == Kind.SUPER_WILDCARD) { - return chainDots(builderType, "java", "lang", "Object"); + return genJavaLangTypeRef(builderType, "Object"); } else if (originalType.getKind() == Kind.EXTENDS_WILDCARD) { try { return cloneType(maker, (JCExpression) ((JCWildcard) originalType).inner, source, builderType.getContext()); } catch (Exception e) { - return chainDots(builderType, "java", "lang", "Object"); + return genJavaLangTypeRef(builderType, "Object"); } } else { return cloneType(maker, originalType, source, builderType.getContext()); |