mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-17 12:16:13 +00:00
Remove a wrong test for copyAnnotations returning empty array.
This commit is contained in:
1 parent
06371ca258
commit
842a475916
4 files changed
+12
-21
No files matched your search
@@ -333,8 +333,9 @@ public class HandleConstructor {
|
||||
Statement nullCheck = generateNullCheck(field, sourceNode);
|
||||
if (nullCheck != null) nullChecks.add(nullCheck);
|
||||
}
|
||||
Annotation[] copiedAnnotations = copyAnnotations(source, nonNulls, nullables);
|
||||
if (copiedAnnotations.length != 0) parameter.annotations = copiedAnnotations;
|
||||
|
||||
parameter.annotations = copyAnnotations(source, nonNulls, nullables);
|
||||
|
||||
params.add(parameter);
|
||||
}
|
||||
|
||||
@@ -348,10 +349,9 @@ public class HandleConstructor {
|
||||
constructorProperties = createConstructorProperties(source, fields);
|
||||
}
|
||||
|
||||
Annotation[] copiedAnnotations = copyAnnotations(source,
|
||||
constructor.annotations = copyAnnotations(source,
|
||||
onConstructor.toArray(new Annotation[0]),
|
||||
constructorProperties);
|
||||
if (copiedAnnotations.length != 0) constructor.annotations = copiedAnnotations;
|
||||
}
|
||||
|
||||
constructor.traverse(new SetGeneratedByVisitor(source), typeDeclaration.scope);
|
||||
@@ -397,8 +397,7 @@ public class HandleConstructor {
|
||||
|
||||
Argument parameter = new Argument(field.name, fieldPos, copyType(field.type, source), Modifier.FINAL);
|
||||
|
||||
Annotation[] copiedAnnotations = copyAnnotations(source, findAnnotations(field, NON_NULL_PATTERN), findAnnotations(field, NULLABLE_PATTERN));
|
||||
if (copiedAnnotations.length != 0) parameter.annotations = copiedAnnotations;
|
||||
parameter.annotations = copyAnnotations(source, findAnnotations(field, NON_NULL_PATTERN), findAnnotations(field, NULLABLE_PATTERN));
|
||||
params.add(parameter);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,14 +270,12 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> {
|
||||
deprecated = new Annotation[] { generateDeprecatedAnnotation(source) };
|
||||
}
|
||||
|
||||
Annotation[] copiedAnnotations = copyAnnotations(source,
|
||||
method.annotations = copyAnnotations(source,
|
||||
onMethod.toArray(new Annotation[0]),
|
||||
findAnnotations(field, NON_NULL_PATTERN),
|
||||
findAnnotations(field, NULLABLE_PATTERN),
|
||||
findDelegatesAndMarkAsHandled(fieldNode),
|
||||
deprecated);
|
||||
|
||||
if (copiedAnnotations.length != 0) method.annotations = copiedAnnotations;
|
||||
}
|
||||
|
||||
method.traverse(new SetGeneratedByVisitor(source), parent.scope);
|
||||
|
||||
@@ -216,10 +216,8 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
|
||||
if (isFieldDeprecated(fieldNode)) {
|
||||
deprecated = new Annotation[] { generateDeprecatedAnnotation(source) };
|
||||
}
|
||||
Annotation[] copiedAnnotations = copyAnnotations(source, onMethod.toArray(new Annotation[0]), deprecated);
|
||||
if (copiedAnnotations.length != 0) {
|
||||
method.annotations = copiedAnnotations;
|
||||
}
|
||||
method.annotations = copyAnnotations(source, onMethod.toArray(new Annotation[0]), deprecated);
|
||||
|
||||
Argument param = new Argument(field.name, p, copyType(field.type, source), Modifier.FINAL);
|
||||
param.sourceStart = pS; param.sourceEnd = pE;
|
||||
method.arguments = new Argument[] { param };
|
||||
@@ -253,8 +251,7 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
|
||||
}
|
||||
method.statements = statements.toArray(new Statement[0]);
|
||||
|
||||
Annotation[] copiedAnnotationsParam = copyAnnotations(source, nonNulls, nullables, onParam.toArray(new Annotation[0]));
|
||||
if (copiedAnnotationsParam.length != 0) param.annotations = copiedAnnotationsParam;
|
||||
param.annotations = copyAnnotations(source, nonNulls, nullables, onParam.toArray(new Annotation[0]));
|
||||
|
||||
method.traverse(new SetGeneratedByVisitor(source), parent.scope);
|
||||
return method;
|
||||
|
||||
@@ -227,10 +227,8 @@ public class HandleWither extends EclipseAnnotationHandler<Wither> {
|
||||
if (isFieldDeprecated(fieldNode)) {
|
||||
deprecated = new Annotation[] { generateDeprecatedAnnotation(source) };
|
||||
}
|
||||
Annotation[] copiedAnnotations = copyAnnotations(source, onMethod.toArray(new Annotation[0]), deprecated);
|
||||
if (copiedAnnotations.length != 0) {
|
||||
method.annotations = copiedAnnotations;
|
||||
}
|
||||
method.annotations = copyAnnotations(source, onMethod.toArray(new Annotation[0]), deprecated);
|
||||
|
||||
Argument param = new Argument(field.name, p, copyType(field.type, source), Modifier.FINAL);
|
||||
param.sourceStart = pS; param.sourceEnd = pE;
|
||||
method.arguments = new Argument[] { param };
|
||||
@@ -283,8 +281,7 @@ public class HandleWither extends EclipseAnnotationHandler<Wither> {
|
||||
|
||||
method.statements = statements.toArray(new Statement[0]);
|
||||
|
||||
Annotation[] copiedAnnotationsParam = copyAnnotations(source, nonNulls, nullables, onParam.toArray(new Annotation[0]));
|
||||
if (copiedAnnotationsParam.length != 0) param.annotations = copiedAnnotationsParam;
|
||||
param.annotations = copyAnnotations(source, nonNulls, nullables, onParam.toArray(new Annotation[0]));
|
||||
|
||||
method.traverse(new SetGeneratedByVisitor(source), parent.scope);
|
||||
return method;
|
||||
|
||||
Reference in new issue
Block a user