code review and fixes for the ‘copyable annotations’ setting concept.

This commit is contained in:
Reinier Zwitserloot committed 2018-09-11 01:59:19 +02:00
1 parent cd8434feee
commit cc8370ab2d
54 files changed
+244 -513

No files matched your search

+3 -3
View File
@@ -565,10 +565,10 @@ public class ConfigurationKeys {
public static final ConfigurationKey<Boolean> STOP_BUBBLING = new ConfigurationKey<Boolean>("config.stopBubbling", "Tell the configuration system it should stop looking for other configuration files (default: false).") {};
/**
* lombok configuration: {@code lombok.copyAnnotations} += &lt;String: fully-qualified annotation class name&gt;.
* lombok configuration: {@code lombok.copyableAnnotations} += &lt;String: fully-qualified annotation class name&gt;.
*
* Copy these annotations to getters, setters, etc.
* Copy these annotations to getters, setters, withers, builder-setters, etc.
*/
public static final ConfigurationKey<List<String>> COPY_ANNOTATIONS = new ConfigurationKey<List<String>>("lombok.copyAnnotations", "Copy these annotations to getters, setters, etc.") {};
public static final ConfigurationKey<List<String>> COPYABLE_ANNOTATIONS = new ConfigurationKey<List<String>>("lombok.copyableAnnotations", "Copy these annotations to getters, setters, withers, builder-setters, etc.") {};
}
@@ -230,9 +230,9 @@ public class HandlerUtil {
public static final String DEFAULT_EXCEPTION_FOR_NON_NULL = "java.lang.NullPointerException";
/** Returns the configuration value for ConfigurationKeys.COPY_ANNOTATIONS. */
public static List<String> copyAnnotationNames(AST<?, ?, ?> ast) {
return ast.readConfiguration(ConfigurationKeys.COPY_ANNOTATIONS);
/** Returns the configuration value for ConfigurationKeys.COPYABLE_ANNOTATIONS. */
public static List<String> getCopyableAnnotationNames(AST<?, ?, ?> ast) {
return ast.readConfiguration(ConfigurationKeys.COPYABLE_ANNOTATIONS);
}
/**
@@ -672,6 +672,24 @@ public class EclipseHandlerUtil {
}
}
private static final Annotation[] EMPTY_ANNOTATIONS_ARRAY = new Annotation[0];
/**
* Searches the given field node for annotations and returns each one that matches the provided list of names.
*/
public static Annotation[] findExactAnnotations(AbstractVariableDeclaration field, List<String> names) {
List<Annotation> result = new ArrayList<Annotation>();
if (field.annotations == null) return EMPTY_ANNOTATIONS_ARRAY;
for (Annotation annotation : field.annotations) {
TypeReference typeRef = annotation.type;
if (typeRef != null && typeRef.getTypeName() != null) {
String annoName = toQualifiedName(typeRef.getTypeName());
if (names.contains(annoName)) result.add(annotation);
}
}
return result.toArray(EMPTY_ANNOTATIONS_ARRAY);
}
/**
* Checks if the provided annotation type is likely to be the intended type for the given annotation node.
*
@@ -202,8 +202,8 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
Annotation[] nonNulls = findAnnotations(fd, NON_NULL_PATTERN);
Annotation[] nullables = findAnnotations(fd, NULLABLE_PATTERN);
Annotation[] copyAnnotations = findExactAnnotations(fd, copyAnnotationNames(fieldNode.getAst()));
Annotation[] copyAnnotations = findExactAnnotations(fd, getCopyableAnnotationNames(fieldNode.getAst()));
BuilderFieldData bfd = new BuilderFieldData();
bfd.rawName = fieldNode.getName().toCharArray();
bfd.name = removePrefixFromField(fieldNode);
@@ -380,9 +380,14 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
if (param.getKind() != Kind.ARGUMENT) continue;
BuilderFieldData bfd = new BuilderFieldData();
Argument arg = (Argument) param.get();
Annotation[] nonNulls = findAnnotations(arg, NON_NULL_PATTERN);
Annotation[] nullables = findAnnotations(arg, NULLABLE_PATTERN);
Annotation[] copyAnnotations = findExactAnnotations(arg, getCopyableAnnotationNames(param.getAst()));
bfd.rawName = arg.name;
bfd.name = arg.name;
bfd.annotations = arg.annotations;
bfd.annotations = copyAnnotations(arg, nonNulls, nullables, copyAnnotations);
bfd.type = arg.type;
bfd.singularData = getSingularData(param, ast);
bfd.originalFieldNode = param;
@@ -774,7 +779,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
String setterName = fluent ? fieldNode.getName() : HandlerUtil.buildAccessorName("set", fieldNode.getName());
MethodDeclaration setter = HandleSetter.createSetter(td, deprecate, fieldNode, setterName, nameOfSetFlag, chain, ClassFileConstants.AccPublic,
sourceNode, Collections.<Annotation>emptyList(), annotations != null ? Arrays.asList(annotations) : Collections.<Annotation>emptyList());
sourceNode, Collections.<Annotation>emptyList(), annotations != null ? Arrays.asList(copyAnnotations(sourceNode.get(), annotations)) : Collections.<Annotation>emptyList());
injectMethod(builderType, setter);
}
@@ -405,7 +405,7 @@ public class HandleConstructor {
Argument parameter = new Argument(fieldName, fieldPos, copyType(field.type, source), Modifier.FINAL);
Annotation[] nonNulls = findAnnotations(field, NON_NULL_PATTERN);
Annotation[] nullables = findAnnotations(field, NULLABLE_PATTERN);
Annotation[] copyAnnotations = findExactAnnotations(field, copyAnnotationNames(fieldNode.getAst()));
Annotation[] copyAnnotations = findExactAnnotations(field, getCopyableAnnotationNames(fieldNode.getAst()));
if (nonNulls.length != 0) {
Statement nullCheck = generateNullCheck(parameter, sourceNode);
if (nullCheck != null) nullChecks.add(nullCheck);
@@ -274,7 +274,7 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> {
onMethod.toArray(new Annotation[0]),
findAnnotations(field, NON_NULL_PATTERN),
findAnnotations(field, NULLABLE_PATTERN),
findExactAnnotations(field, copyAnnotationNames(fieldNode.getAst())),
findExactAnnotations(field, getCopyableAnnotationNames(fieldNode.getAst())),
findDelegatesAndMarkAsHandled(fieldNode),
deprecated);
}
@@ -238,7 +238,7 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
Annotation[] nonNulls = findAnnotations(field, NON_NULL_PATTERN);
Annotation[] nullables = findAnnotations(field, NULLABLE_PATTERN);
Annotation[] copyAnnotations = findExactAnnotations(field, copyAnnotationNames(fieldNode.getAst()));
Annotation[] copyableAnnotations = findExactAnnotations(field, getCopyableAnnotationNames(fieldNode.getAst()));
List<Statement> statements = new ArrayList<Statement>(5);
if (nonNulls.length == 0) {
statements.add(assignment);
@@ -256,7 +256,7 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
statements.add(returnStatement);
}
method.statements = statements.toArray(new Statement[0]);
param.annotations = copyAnnotations(source, nonNulls, nullables, copyAnnotations, onParam.toArray(new Annotation[0]));
param.annotations = copyAnnotations(source, nonNulls, nullables, copyableAnnotations, onParam.toArray(new Annotation[0]));
method.traverse(new SetGeneratedByVisitor(source), parent.scope);
return method;
@@ -242,7 +242,7 @@ public class HandleWither extends EclipseAnnotationHandler<Wither> {
Annotation[] nonNulls = findAnnotations(field, NON_NULL_PATTERN);
Annotation[] nullables = findAnnotations(field, NULLABLE_PATTERN);
Annotation[] copyAnnotations = findExactAnnotations(field, copyAnnotationNames(fieldNode.getAst()));
Annotation[] copyableAnnotations = findExactAnnotations(field, getCopyableAnnotationNames(fieldNode.getAst()));
if (!makeAbstract) {
List<Expression> args = new ArrayList<Expression>();
@@ -286,7 +286,7 @@ public class HandleWither extends EclipseAnnotationHandler<Wither> {
method.statements = statements.toArray(new Statement[0]);
}
param.annotations = copyAnnotations(source, nonNulls, nullables, copyAnnotations, onParam.toArray(new Annotation[0]));
param.annotations = copyAnnotations(source, nonNulls, nullables, copyableAnnotations, onParam.toArray(new Annotation[0]));
method.traverse(new SetGeneratedByVisitor(source), parent.scope);
return method;
@@ -149,15 +149,15 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
JCVariableDecl fd = (JCVariableDecl) fieldNode.get();
JavacNode isDefault = findAnnotation(Builder.Default.class, fieldNode, false);
boolean isFinal = (fd.mods.flags & Flags.FINAL) != 0 || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode));
List<JCAnnotation> nonNulls = findAnnotations(fieldNode, NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(fieldNode, NULLABLE_PATTERN);
List<JCAnnotation> copyAnnotations = findExactAnnotations(fieldNode, copyAnnotationNames(fieldNode.getAst()));
List<JCAnnotation> copyableAnnotations = findExactAnnotations(fieldNode, getCopyableAnnotationNames(fieldNode.getAst()));
BuilderFieldData bfd = new BuilderFieldData();
bfd.rawName = fd.name;
bfd.name = removePrefixFromField(fieldNode);
bfd.annotations = nonNulls.appendList(nullables).appendList(copyAnnotations);
bfd.annotations = nonNulls.appendList(nullables).appendList(copyableAnnotations);
bfd.type = fd.vartype;
bfd.singularData = getSingularData(fieldNode);
bfd.originalFieldNode = fieldNode;
@@ -333,10 +333,15 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
for (JavacNode param : fillParametersFrom.down()) {
if (param.getKind() != Kind.ARGUMENT) continue;
BuilderFieldData bfd = new BuilderFieldData();
List<JCAnnotation> nonNulls = findAnnotations(param, NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(param, NULLABLE_PATTERN);
List<JCAnnotation> copyableAnnotations = findExactAnnotations(param, getCopyableAnnotationNames(param.getAst()));
JCVariableDecl raw = (JCVariableDecl) param.get();
bfd.name = raw.name;
bfd.rawName = raw.name;
bfd.annotations = raw.mods.annotations;
bfd.annotations = nonNulls.appendList(nullables).appendList(copyableAnnotations);
bfd.type = raw.vartype;
bfd.singularData = getSingularData(param);
bfd.originalFieldNode = param;
@@ -331,9 +331,9 @@ public class HandleConstructor {
Name rawName = field.name;
List<JCAnnotation> nonNulls = findAnnotations(fieldNode, NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(fieldNode, NULLABLE_PATTERN);
List<JCAnnotation> copyAnnotations = findExactAnnotations(fieldNode, copyAnnotationNames(fieldNode.getAst()));
List<JCAnnotation> copyableAnnotations = findExactAnnotations(fieldNode, getCopyableAnnotationNames(fieldNode.getAst()));
long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, typeNode.getContext());
JCVariableDecl param = maker.VarDef(maker.Modifiers(flags, nonNulls.appendList(nullables).appendList(copyAnnotations)), fieldName, field.vartype, null);
JCVariableDecl param = maker.VarDef(maker.Modifiers(flags, nonNulls.appendList(nullables).appendList(copyableAnnotations)), fieldName, field.vartype, null);
params.append(param);
if (!nonNulls.isEmpty()) {
JCStatement nullCheck = generateNullCheck(maker, fieldNode, param, source);
@@ -245,11 +245,11 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> {
List<JCAnnotation> nonNulls = findAnnotations(field, NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(field, NULLABLE_PATTERN);
List<JCAnnotation> copyAnnotations = findExactAnnotations(field, copyAnnotationNames(field.getAst()));
List<JCAnnotation> copyableAnnotations = findExactAnnotations(field, getCopyableAnnotationNames(field.getAst()));
List<JCAnnotation> delegates = findDelegatesAndRemoveFromField(field);
List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod).appendList(nonNulls).appendList(nullables).appendList(copyAnnotations);
List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod).appendList(nonNulls).appendList(nullables).appendList(copyableAnnotations);
if (isFieldDeprecated(field)) {
annsOnMethod = annsOnMethod.prepend(treeMaker.Annotation(genJavaLangTypeRef(field, "Deprecated"), List.<JCExpression>nil()));
}
@@ -228,10 +228,10 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> {
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
List<JCAnnotation> nonNulls = findAnnotations(field, NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(field, NULLABLE_PATTERN);
List<JCAnnotation> copyAnnotations = findExactAnnotations(field, copyAnnotationNames(field.getAst()));
List<JCAnnotation> copyableAnnotations = findExactAnnotations(field, getCopyableAnnotationNames(field.getAst()));
Name methodName = field.toName(setterName);
List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(nonNulls).appendList(nullables).appendList(copyAnnotations);
List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(nonNulls).appendList(nullables).appendList(copyableAnnotations);
long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, field.getContext());
JCVariableDecl param = treeMaker.VarDef(treeMaker.Modifiers(flags, annsOnParam), fieldDecl.name, fieldDecl.vartype, null);
@@ -224,7 +224,7 @@ public class HandleWither extends JavacAnnotationHandler<Wither> {
List<JCAnnotation> nonNulls = findAnnotations(field, NON_NULL_PATTERN);
List<JCAnnotation> nullables = findAnnotations(field, NULLABLE_PATTERN);
List<JCAnnotation> copyAnnotations = findExactAnnotations(field, copyAnnotationNames(field.getAst()));
List<JCAnnotation> copyableAnnotations = findExactAnnotations(field, getCopyableAnnotationNames(field.getAst()));
Name methodName = field.toName(witherName);
@@ -232,7 +232,7 @@ public class HandleWither extends JavacAnnotationHandler<Wither> {
JCBlock methodBody = null;
long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, field.getContext());
List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(nonNulls).appendList(nullables).appendList(copyAnnotations);
List<JCAnnotation> annsOnParam = copyAnnotations(onParam).appendList(nonNulls).appendList(nullables).appendList(copyableAnnotations);
JCVariableDecl param = maker.VarDef(maker.Modifiers(flags, annsOnParam), fieldDecl.name, fieldDecl.vartype, null);
@@ -1343,15 +1343,13 @@ public class JavacHandlerUtil {
for (JavacNode child : fieldNode.down()) {
if (child.getKind() == Kind.ANNOTATION) {
JCAnnotation annotation = (JCAnnotation) child.get();
String annoname = annotation.annotationType.toString();
if (names.contains(annoname)) {
result.append(annotation);
}
String annoName = annotation.annotationType.toString();
if (names.contains(annoName)) result.append(annotation);
}
}
return result.toList();
}
/**
* Generates a new statement that checks if the given variable is null, and if so, throws a configured exception with the
* variable name as message.
+2 -20
View File
@@ -31,11 +31,11 @@ import lombok.core.ClassLiteral;
import lombok.core.FieldSelect;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess;
import org.eclipse.jdt.internal.compiler.ast.Clinit;
import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Literal;
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
import org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
@@ -139,7 +139,7 @@ public class Eclipse {
*
* Only the simple name is checked - the package and any containing class are ignored.
*/
public static Annotation[] findAnnotations(FieldDeclaration field, Pattern namePattern) {
public static Annotation[] findAnnotations(AbstractVariableDeclaration field, Pattern namePattern) {
List<Annotation> result = new ArrayList<Annotation>();
if (field.annotations == null) return EMPTY_ANNOTATIONS_ARRAY;
for (Annotation annotation : field.annotations) {
@@ -155,24 +155,6 @@ public class Eclipse {
return result.toArray(EMPTY_ANNOTATIONS_ARRAY);
}
/**
* Searches the given field node for annotations and returns each one that matches the provided list of names.
*/
public static Annotation[] findExactAnnotations(FieldDeclaration field, List<String> names) {
List<Annotation> result = new ArrayList<Annotation>();
if (field.annotations == null) return EMPTY_ANNOTATIONS_ARRAY;
for (Annotation annotation : field.annotations) {
TypeReference typeRef = annotation.type;
if (typeRef != null && typeRef.getTypeName() != null) {
String annoname = toQualifiedName(typeRef.getTypeName());
if (names.contains(annoname)) {
result.add(annotation);
}
}
}
return result.toArray(EMPTY_ANNOTATIONS_ARRAY);
}
/** Matches any of the 8 primitive names, such as {@code boolean}. */
private static final Pattern PRIMITIVE_TYPE_NAME_PATTERN = Pattern.compile(
"^(boolean|byte|short|int|long|float|double|char)$");
@@ -1,48 +1,42 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class BuilderTypeAnnos {
@TA
private List<@TA String> foo;
@TB
private List<String> foo;
@java.lang.SuppressWarnings("all")
BuilderTypeAnnos(final List<@TA String> foo) {
BuilderTypeAnnos(@TA final List<String> foo) {
this.foo = foo;
}
@java.lang.SuppressWarnings("all")
public static class BuilderTypeAnnosBuilder {
@java.lang.SuppressWarnings("all")
private List<@TA String> foo;
private List<String> foo;
@java.lang.SuppressWarnings("all")
BuilderTypeAnnosBuilder() {
}
@java.lang.SuppressWarnings("all")
public BuilderTypeAnnosBuilder foo(final List<@TA String> foo) {
public BuilderTypeAnnosBuilder foo(@TA final List<String> foo) {
this.foo = foo;
return this;
}
@java.lang.SuppressWarnings("all")
public BuilderTypeAnnos build() {
return new BuilderTypeAnnos(foo);
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo + ")";
}
}
@java.lang.SuppressWarnings("all")
public static BuilderTypeAnnosBuilder builder() {
return new BuilderTypeAnnosBuilder();
@@ -1,51 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class BuilderTypeAnnos {
@TA
private List<@TA String> foo;
@java.lang.SuppressWarnings("all")
BuilderTypeAnnos(@TA final List<@TA String> foo) {
this.foo = foo;
}
@java.lang.SuppressWarnings("all")
public static class BuilderTypeAnnosBuilder {
@java.lang.SuppressWarnings("all")
private List<@TA String> foo;
@java.lang.SuppressWarnings("all")
BuilderTypeAnnosBuilder() {
}
@java.lang.SuppressWarnings("all")
public BuilderTypeAnnosBuilder foo(@TA final List<@TA String> foo) {
this.foo = foo;
return this;
}
@java.lang.SuppressWarnings("all")
public BuilderTypeAnnos build() {
return new BuilderTypeAnnos(foo);
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo + ")";
}
}
@java.lang.SuppressWarnings("all")
public static BuilderTypeAnnosBuilder builder() {
return new BuilderTypeAnnosBuilder();
}
}
@@ -0,0 +1,18 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class ConstructorsTypeAnnos {
@TA
@TB
List<String> foo;
@java.lang.SuppressWarnings("all")
public ConstructorsTypeAnnos(@TA final List<String> foo) {
this.foo = foo;
}
}
@@ -1,17 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class ConstructorsTypeAnnos {
@TA
List<@TA String> foo;
@java.lang.SuppressWarnings("all")
public ConstructorsTypeAnnos(@TA final List<@TA String> foo) {
this.foo = foo;
}
}
@@ -1,17 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class ConstructorsTypeAnnos {
@TA
List<@TA String> foo;
@java.lang.SuppressWarnings("all")
public ConstructorsTypeAnnos(final List<@TA String> foo) {
this.foo = foo;
}
}
@@ -0,0 +1,19 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class GetterTypeAnnos {
@TA
@TB
List<String> foo;
@TA
@java.lang.SuppressWarnings("all")
public List<String> getFoo() {
return this.foo;
}
}
@@ -1,18 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class GetterTypeAnnos {
@TA
List<@TA String> foo;
@TA
@java.lang.SuppressWarnings("all")
public List<@TA String> getFoo() {
return this.foo;
}
}
@@ -1,17 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class GetterTypeAnnos {
@TA
List<@TA String> foo;
@java.lang.SuppressWarnings("all")
public List<@TA String> getFoo() {
return this.foo;
}
}
@@ -0,0 +1,18 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class SetterTypeAnnos {
@TA
@TB
List<String> foo;
@java.lang.SuppressWarnings("all")
public void setFoo(@TA final List<String> foo) {
this.foo = foo;
}
}
@@ -1,17 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class SetterTypeAnnos {
@TA
List<@TA String> foo;
@java.lang.SuppressWarnings("all")
public void setFoo(@TA final List<@TA String> foo) {
this.foo = foo;
}
}
@@ -1,17 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class SetterTypeAnnos {
@TA
List<@TA String> foo;
@java.lang.SuppressWarnings("all")
public void setFoo(final List<@TA String> foo) {
this.foo = foo;
}
}
@@ -0,0 +1,21 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class WitherTypeAnnos {
@TA
@TB
final List<String> foo;
WitherTypeAnnos(@TA @TB List<String> foo) {
this.foo = foo;
}
@java.lang.SuppressWarnings("all")
public WitherTypeAnnos withFoo(@TA final List<String> foo) {
return this.foo == foo ? this : new WitherTypeAnnos(foo);
}
}
@@ -1,21 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class WitherTypeAnnos {
@TA
final List<@TA String> foo;
WitherTypeAnnos(@TA List<@TA String> foo) {
this.foo = foo;
}
@java.lang.SuppressWarnings("all")
public WitherTypeAnnos withFoo(@TA final List<@TA String> foo) {
return this.foo == foo ? this : new WitherTypeAnnos(foo);
}
}
@@ -1,21 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class WitherTypeAnnos {
@TA
final List<@TA String> foo;
WitherTypeAnnos(@TA List<@TA String> foo) {
this.foo = foo;
}
@java.lang.SuppressWarnings("all")
public WitherTypeAnnos withFoo(final List<@TA String> foo) {
return this.foo == foo ? this : new WitherTypeAnnos(foo);
}
}
@@ -1,7 +1,9 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB {
}
@lombok.Builder class BuilderTypeAnnos {
public static @java.lang.SuppressWarnings("all") class BuilderTypeAnnosBuilder {
@@ -20,7 +22,7 @@ import java.util.List;
return (("BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo) + ")");
}
}
private @TA List<@TA String> foo;
private @TA @TB List<String> foo;
@java.lang.SuppressWarnings("all") BuilderTypeAnnos(final @TA List<String> foo) {
super();
this.foo = foo;
@@ -1,31 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
}
@lombok.Builder class BuilderTypeAnnos {
public static @java.lang.SuppressWarnings("all") class BuilderTypeAnnosBuilder {
private @java.lang.SuppressWarnings("all") List<String> foo;
@java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder() {
super();
}
public @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder foo(final List<String> foo) {
this.foo = foo;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderTypeAnnos build() {
return new BuilderTypeAnnos(foo);
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (("BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo) + ")");
}
}
private @TA List<@TA String> foo;
@java.lang.SuppressWarnings("all") BuilderTypeAnnos(final List<String> foo) {
super();
this.foo = foo;
}
public static @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder builder() {
return new BuilderTypeAnnosBuilder();
}
}
@@ -1,10 +1,12 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB {
}
@lombok.AllArgsConstructor class ConstructorsTypeAnnos {
@TA List<@TA String> foo;
@TA @TB List<String> foo;
public @java.lang.SuppressWarnings("all") ConstructorsTypeAnnos(final @TA List<String> foo) {
super();
this.foo = foo;
@@ -1,12 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
}
@lombok.AllArgsConstructor class ConstructorsTypeAnnos {
@TA List<@TA String> foo;
public @java.lang.SuppressWarnings("all") ConstructorsTypeAnnos(final List<String> foo) {
super();
this.foo = foo;
}
}
@@ -2,10 +2,12 @@ import lombok.Getter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB {
}
class GetterTypeAnnos {
@Getter @TA List<@TA String> foo;
@Getter @TA @TB List<String> foo;
GetterTypeAnnos() {
super();
}
@@ -1,15 +0,0 @@
import lombok.Getter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
}
class GetterTypeAnnos {
@Getter @TA List<@TA String> foo;
GetterTypeAnnos() {
super();
}
public @java.lang.SuppressWarnings("all") List<String> getFoo() {
return this.foo;
}
}
@@ -2,10 +2,12 @@ import lombok.Setter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB {
}
class SetterTypeAnnos {
@Setter @TA List<@TA String> foo;
@Setter @TA @TB List<String> foo;
SetterTypeAnnos() {
super();
}
@@ -1,15 +0,0 @@
import lombok.Setter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
}
class SetterTypeAnnos {
@Setter @TA List<@TA String> foo;
SetterTypeAnnos() {
super();
}
public @java.lang.SuppressWarnings("all") void setFoo(final List<String> foo) {
this.foo = foo;
}
}
@@ -2,11 +2,13 @@ import lombok.experimental.Wither;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB {
}
class WitherTypeAnnos {
final @Wither @TA List<@TA String> foo;
WitherTypeAnnos(@TA List<@TA String> foo) {
final @Wither @TA @TB List<String> foo;
WitherTypeAnnos(@TA @TB List<String> foo) {
super();
this.foo = foo;
}
@@ -1,16 +0,0 @@
import lombok.experimental.Wither;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {
}
class WitherTypeAnnos {
final @Wither @TA List<@TA String> foo;
WitherTypeAnnos(@TA List<@TA String> foo) {
super();
this.foo = foo;
}
public @java.lang.SuppressWarnings("all") WitherTypeAnnos withFoo(final List<String> foo) {
return ((this.foo == foo) ? this : new WitherTypeAnnos(foo));
}
}
@@ -0,0 +1,14 @@
//CONF: lombok.copyableAnnotations += TA
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
@lombok.Builder
class BuilderTypeAnnos {
private @TA @TB List<String> foo;
}
@@ -1,14 +0,0 @@
//CONF: lombok.copyAnnotations += TA
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
@lombok.Builder
class BuilderTypeAnnos {
private @TA List<@TA String> foo;
}
@@ -1,12 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
@lombok.Builder
class BuilderTypeAnnos {
private @TA List<@TA String> foo;
}
@@ -0,0 +1,14 @@
//CONF: lombok.copyableAnnotations += TA
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
@lombok.AllArgsConstructor
class ConstructorsTypeAnnos {
@TA @TB List<String> foo;
}
@@ -1,14 +0,0 @@
//CONF: lombok.copyAnnotations += TA
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
@lombok.AllArgsConstructor
class ConstructorsTypeAnnos {
@TA List<@TA String> foo;
}
@@ -1,12 +0,0 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
@lombok.AllArgsConstructor
class ConstructorsTypeAnnos {
@TA List<@TA String> foo;
}
@@ -0,0 +1,15 @@
//CONF: lombok.copyableAnnotations += TA
import lombok.Getter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class GetterTypeAnnos {
@Getter
@TA @TB List<String> foo;
}
@@ -1,16 +0,0 @@
//CONF: lombok.copyAnnotations += TA
import lombok.Getter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class GetterTypeAnnos {
@Getter
@TA List<@TA String> foo;
}
@@ -1,14 +0,0 @@
import lombok.Getter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class GetterTypeAnnos {
@Getter
@TA List<@TA String> foo;
}
@@ -0,0 +1,15 @@
//CONF: lombok.copyableAnnotations += TA
import lombok.Setter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class SetterTypeAnnos {
@Setter
@TA @TB List<String> foo;
}
@@ -1,16 +0,0 @@
//CONF: lombok.copyAnnotations += TA
import lombok.Setter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class SetterTypeAnnos {
@Setter
@TA List<@TA String> foo;
}
@@ -1,14 +0,0 @@
import lombok.Setter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class SetterTypeAnnos {
@Setter
@TA List<@TA String> foo;
}
@@ -0,0 +1,18 @@
//CONF: lombok.copyableAnnotations += TA
import lombok.experimental.Wither;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TA {
}
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@interface TB {
}
class WitherTypeAnnos {
@Wither final @TA @TB List<String> foo;
WitherTypeAnnos(@TA @TB List<String> foo) {
this.foo = foo;
}
}
@@ -1,19 +0,0 @@
//CONF: lombok.copyAnnotations += TA
import lombok.experimental.Wither;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class WitherTypeAnnos {
@Wither final @TA List<@TA String> foo;
WitherTypeAnnos(@TA List<@TA String> foo) {
this.foo = foo;
}
}
@@ -1,17 +0,0 @@
import lombok.experimental.Wither;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@interface TA {
}
class WitherTypeAnnos {
@Wither final @TA List<@TA String> foo;
WitherTypeAnnos(@TA List<@TA String> foo) {
this.foo = foo;
}
}