@@ -75,8 +75,8 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
7575 if (classDeclAfterVisit != classDecl && allFieldsAnnotated ) {
7676 //Add annotation
7777 JavaTemplate template = JavaTemplate .builder ("@Setter\n " )
78- .imports ("lombok.Setter" )
79- .javaParser (JavaParser .fromJavaVersion ().classpath ("lombok" ))
78+ .imports ("lombok.Setter" )
79+ .javaParser (JavaParser .fromJavaVersion ().classpath ("lombok" ))
8080 .build ();
8181
8282 return template .apply (
@@ -87,7 +87,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
8787 }
8888
8989 @ Override
90- public J .VariableDeclarations visitVariableDeclarations (J .VariableDeclarations variableDecls , ExecutionContext ctx ){
90+ public J .VariableDeclarations visitVariableDeclarations (J .VariableDeclarations variableDecls , ExecutionContext ctx ) {
9191
9292 boolean allFieldsAnnotatedSoFar = getCursor ().getNearestMessage (ALL_FIELDS_DECORATED_ACC );
9393 if (!allFieldsAnnotatedSoFar ) {
@@ -112,11 +112,8 @@ private J.VariableDeclarations fixFormat(J.VariableDeclarations initial, J.Varia
112112 //as of August 2024 manual fixes to the format are necessary. Hopefully in the future this method becomes obsolete
113113
114114 boolean isAnnotationOnLineAbove = initial .toString ().contains ("@Setter\n " );
115-
116115 boolean isTopAnnotationRemoved = !initial .getLeadingAnnotations ().isEmpty () &&
117- initial .getLeadingAnnotations ()
118- .get (0 )
119- .getSimpleName ().equals ("Setter" );
116+ "Setter" .equals (initial .getLeadingAnnotations ().get (0 ).getSimpleName ());
120117
121118 if (isAnnotationOnLineAbove && isTopAnnotationRemoved ) {
122119 String minus1NewLine = visited .getPrefix ().getWhitespace ().replaceFirst ("\n " , "" );
@@ -127,7 +124,7 @@ private J.VariableDeclarations fixFormat(J.VariableDeclarations initial, J.Varia
127124
128125 @ Override
129126 public J .@ Nullable Annotation visitAnnotation (J .Annotation annotation , ExecutionContext ctx ) {
130- boolean isSetterAnnotated = annotation .getSimpleName (). equals ( "Setter" ) &&
127+ boolean isSetterAnnotated = "Setter" . equals ( annotation .getSimpleName ()) &&
131128 annotation .getArguments () == null ; //no Access level, or other arguments
132129
133130 return isSetterAnnotated &&
0 commit comments