From b09a4e57d85ae1a8499484bb6ac3ecf8c689a6ac Mon Sep 17 00:00:00 2001 From: timo-a <1398557+timo-a@users.noreply.github.com> Date: Sun, 15 Dec 2024 21:36:30 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../openrewrite/java/migrate/lombok/SummarizeGetter.java | 4 ++-- .../openrewrite/java/migrate/lombok/SummarizeSetter.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeGetter.java b/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeGetter.java index 5f8d821c6..df9f9b20e 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeGetter.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeGetter.java @@ -103,8 +103,8 @@ private J.VariableDeclarations fixFormat(J.VariableDeclarations initial, J.Varia boolean isAnnotationOnLineAbove = initial.toString().contains("@Getter\n"); - boolean isTopAnnotationRemoved = !initial.getLeadingAnnotations().isEmpty() - && initial.getLeadingAnnotations() + boolean isTopAnnotationRemoved = !initial.getLeadingAnnotations().isEmpty() && + initial.getLeadingAnnotations() .get(0) .getSimpleName().equals("Getter"); diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeSetter.java b/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeSetter.java index a8b333995..2dba3ed45 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeSetter.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/SummarizeSetter.java @@ -92,8 +92,8 @@ public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations v boolean hasSetterAnnotation = variableDecls != visited; if (hasSetterAnnotation) { return fixFormat(variableDecls, visited, ctx); - } else if (variableDecls.hasModifier(J.Modifier.Type.Final) - || variableDecls.hasModifier(J.Modifier.Type.Static)) { + } else if (variableDecls.hasModifier(J.Modifier.Type.Final) || + variableDecls.hasModifier(J.Modifier.Type.Static)) { //final fields and static field don't need to have an annotation return visited; } else { @@ -107,8 +107,8 @@ private J.VariableDeclarations fixFormat(J.VariableDeclarations initial, J.Varia boolean isAnnotationOnLineAbove = initial.toString().contains("@Setter\n"); - boolean isTopAnnotationRemoved = !initial.getLeadingAnnotations().isEmpty() - && initial.getLeadingAnnotations() + boolean isTopAnnotationRemoved = !initial.getLeadingAnnotations().isEmpty() && + initial.getLeadingAnnotations() .get(0) .getSimpleName().equals("Setter");