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

📍Use lombok, reformat, and optimize the code #1560

Merged
merged 4 commits into from
Mar 13, 2021
Merged

📍Use lombok, reformat, and optimize the code #1560

merged 4 commits into from
Mar 13, 2021

Conversation

va1m
Copy link
Contributor

@va1m va1m commented Oct 12, 2020

Use lombok

Pull request description

  • Use @Slf4j instead of LOGGER var definition and initialisation
  • Use @Getter and @Setter instead of vanila java implementations
  • Use @ToString instead of custom implementations
  • Use @EqualsAndHashcode instead of manually created equals() and hashCode()
  • Autoformat project java classes
  • Remove public for test methods using JUnit5

@sumitaccess007
Copy link

Hi @iluwatar
Can I start working on this to refactor the code and use Lombok Library, If yes, please assign to me.

@va1m
Copy link
Contributor Author

va1m commented Oct 17, 2020

Hi @iluwatar
Can I start working on this to refactor the code and use Lombok Library, If yes, please assign to me.

Hi @sumitaccess007, this pull request already uses lombok library.

@va1m
Copy link
Contributor Author

va1m commented Oct 24, 2020

@iluwatar, can you please review the PR?

@va1m va1m changed the title Use lombok, reformat, and optimize the code 📍Use lombok, reformat, and optimize the code Oct 24, 2020
Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

This is a very long Pull Request and will take time to get reviewed.

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

I have also seen that you have made changes in Junit code as well.
But have not mentioned it in the PR description.

It would be great if you could provide a solid documentation for each changes in the PR.

@iluwatar
Copy link
Owner

iluwatar commented Dec 4, 2020

There are conflicts that need to be resolved @va1m

Copy link
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

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

The changes look good to me and we can merge it once the conflict have been resolved.

  • In the future please keep the pull request scope smaller, for example one PR per pattern would be much easier to review and merge quickly. It takes an hour or two to even read through the changes when there are 692 files changed.
  • Try to avoid incorporating unrelated changes in the same pull request. Like here there were hundreds of changes in test files, reformatting and small bug fixes.
  • I added a page to our wiki collecting the allowed Lombok annotations: https://github.com/iluwatar/java-design-patterns/wiki/18.-Lombok Please comments if there's something missing that we are using/want to use

@ohbus
Copy link
Contributor

ohbus commented Feb 1, 2021

@va1m and @iluwatar Please check as I have updated the code removing the merge conflicts as It was pending for a long time even after approval.

Thanks.

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

@va1m Can you please look at what are the changes that is breaking the code.

Thanks.

@MrR0807
Copy link

MrR0807 commented Feb 25, 2021

Instead of introducing Lombok, use Java 16 and records wherever possible. Also, be aware that record builders are also in works.

@iluwatar
Copy link
Owner

Instead of introducing Lombok, use Java 16 and records wherever possible. Also, be aware that record builders are also in works.

Thanks @MrR0807 this looks very interesting development indeed. However, currently the project is on Java 11 level and it will take some time to get us compatible with Java 16. What we can do at this stage is to create an issue about this so we can get back to it at some later stage.

@ohbus
Copy link
Contributor

ohbus commented Mar 7, 2021

@va1m this PR has been inactive for a long time, we will close it soon if we do not see any updates.

@ohbus ohbus added the status: stale issues and pull requests that have not had recent interaction label Mar 7, 2021
@sonarcloud
Copy link

sonarcloud bot commented Mar 7, 2021

@va1m
Copy link
Contributor Author

va1m commented Mar 7, 2021

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

@va1m you need to provide test cases to increase code coverage.

@ohbus ohbus removed the status: stale issues and pull requests that have not had recent interaction label Mar 8, 2021
@ohbus
Copy link
Contributor

ohbus commented Mar 8, 2021

@iluwatar I fixed the conflicts but I have no idea how to fix the sonarCloud issue https://sonarcloud.io/project/issues?id=iluwatar_java-design-patterns&open=AXgOdcr_XiJrFJc0KlII&pullRequest=1560&resolved=false&severities=MAJOR&types=CODE_SMELL

I believe this issue can be fixed just by refactoring it into two separate chunks. @va1m

@va1m
Copy link
Contributor Author

va1m commented Mar 8, 2021

@va1m you need to provide test cases to increase code coverage.

I didn't append new code and code coverage shouldn't being decreased. If it happened then probably it's a SonarQube configuration issue related to lombok and it should be configured accordingly.

Anyway, I have no more time to spend on this pr. Feel free to finish it yourself if you need it.

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

Thank you @va1m for your contribution.

We will wait for @iluwatar as he reviews the PR with the conflicts removed.

@iluwatar iluwatar added this to the 1.24.0 milestone Mar 13, 2021
@iluwatar iluwatar merged commit 5cf2fe0 into iluwatar:master Mar 13, 2021
@iluwatar
Copy link
Owner

We are extremely thankful for this huge contribution @va1m! I think these numbers tell a great story of how much boilerplate it removed:

image

@all-contributors please add @va1m for code

@allcontributors
Copy link
Contributor

@iluwatar

I've put up a pull request to add @va1m! 🎉

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

Successfully merging this pull request may close these issues.

5 participants