Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use lombok @NoArgsConstructor annotation #645

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timo-a
Copy link
Contributor

@timo-a timo-a commented Dec 24, 2024

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files


import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import lombok.Value;
import lombok.Value;
import org.jspecify.annotations.Nullable;

Comment on lines +76 to +78
JavaTemplate.Builder builder = AccessLevel.PUBLIC.equals(accessLevel)
? JavaTemplate.builder("@NoArgsConstructor()\n")
: JavaTemplate.builder("@NoArgsConstructor(access = AccessLevel." + accessLevel.name() + ")\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JavaTemplate.Builder builder = AccessLevel.PUBLIC.equals(accessLevel)
? JavaTemplate.builder("@NoArgsConstructor()\n")
: JavaTemplate.builder("@NoArgsConstructor(access = AccessLevel." + accessLevel.name() + ")\n")
JavaTemplate.Builder builder = AccessLevel.PUBLIC.equals(accessLevel) ?
JavaTemplate.builder("@NoArgsConstructor()\n") :
JavaTemplate.builder("@NoArgsConstructor(access = AccessLevel." + accessLevel.name() + ")\n")

}

@Override
public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) {
public @Nullable J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant