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

Remove redundant conflicts from Lombok generated code. #119

Open
nimakarimipour opened this issue Dec 23, 2022 · 0 comments
Open

Remove redundant conflicts from Lombok generated code. #119

nimakarimipour opened this issue Dec 23, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@nimakarimipour
Copy link
Member

Following #118 we had significant increase on the number of conflicts due to Lombok generated code. Looking at generated code by Lombok, It generates three methods equals(), hashcode() and toString() which want to operate on all class fields in their body. This means that if the class has n fields, it will require at least n builds while it is impossible for these three methods to have an NPE on the method body or at the call sites (Their body is written with null-checks). Looking more into lombok generated code, it seems if a field is @Nullable, all code using that field is written with null-checks. It seems to me that regions created by lombok are free of NPEs and we can exclude usages in those regions. This will have a significant impact on reduction of conflicts.

The reason that we are seeing the updated version having more conflicts than previous one is that in the body of equals(), hashCode() and toString() Lombok, instead of using direct reference to fields, it uses getter methods for that fields, and this causes a lot of conflicts.

@nimakarimipour nimakarimipour added the enhancement New feature or request label Dec 23, 2022
@nimakarimipour nimakarimipour self-assigned this Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant