diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java index 74537131ba..f76f35fe63 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java @@ -99,7 +99,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex return cd; } - assert cd.getType() != null:"Class type must not be null"; + assert cd.getType() != null : "Class type must not be null"; Set memberVariableNames = getMemberVariableNames(memberVariables); if (implementsConflictingInterfaces(cd, memberVariableNames)) { return cd; @@ -115,12 +115,12 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex private boolean isRelevantClass(J.ClassDeclaration classDeclaration) { List allAnnotations = classDeclaration.getAllAnnotations(); return classDeclaration.getType() != null - && !J.ClassDeclaration.Kind.Type.Record.equals(classDeclaration.getKind()) - && !allAnnotations.isEmpty() - && allAnnotations.stream().allMatch(ann -> LOMBOK_VALUE_MATCHER.matches(ann) && (ann.getArguments() == null || ann.getArguments().isEmpty())) - && !hasGenericTypeParameter(classDeclaration) - && classDeclaration.getBody().getStatements().stream().allMatch(this::isRecordCompatibleField) - && !hasIncompatibleModifier(classDeclaration); + && !J.ClassDeclaration.Kind.Type.Record.equals(classDeclaration.getKind()) + && !allAnnotations.isEmpty() + && allAnnotations.stream().allMatch(ann -> LOMBOK_VALUE_MATCHER.matches(ann) && (ann.getArguments() == null || ann.getArguments().isEmpty())) + && !hasGenericTypeParameter(classDeclaration) + && classDeclaration.getBody().getStatements().stream().allMatch(this::isRecordCompatibleField) + && !hasIncompatibleModifier(classDeclaration); } /** @@ -251,8 +251,8 @@ private boolean isMethodInvocationOnRecordTypeClassMember(J.MethodInvocation met String classFqn = classType.getFullyQualifiedName(); return recordTypeToMembers.containsKey(classFqn) - && methodName.startsWith(STANDARD_GETTER_PREFIX) - && recordTypeToMembers.get(classFqn).contains(getterMethodNameToFluentMethodName(methodName)); + && methodName.startsWith(STANDARD_GETTER_PREFIX) + && recordTypeToMembers.get(classFqn).contains(getterMethodNameToFluentMethodName(methodName)); } private static boolean isClassExpression(@Nullable Expression expression) { @@ -301,7 +301,7 @@ private static String memberVariablesToString(Set memberVariables) { } private static JavaType.Class buildRecordType(J.ClassDeclaration classDeclaration) { - assert classDeclaration.getType() != null:"Class type must not be null"; + assert classDeclaration.getType() != null : "Class type must not be null"; String className = classDeclaration.getType().getFullyQualifiedName(); return JavaType.ShallowClass.build(className)