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

Documentation and modernization of the code #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

verhas
Copy link

@verhas verhas commented Mar 13, 2021

While I was scanning the code, I played with it and added some JavaDoc, and I also refactored the code a bit. There was some copy-paste in the code, many of which I eliminated by introducing a new interface and abstract classes. The code compiles and the unit tests run, but I am not easy because I have found certain errors I made (and later fixed) during refactoring that were not discovered by the unit tests. The line coverage is good, but that is not enough.

For example, if you look at the line AbstractSpiProcessor:137

                    return !(implementationResult.isError() && reportError(te, implementationResult));

Removing the ! character after the return keyword is a significant change. The unit tests just run fine.

I still see some abstraction and architectural issues in the code. For example, writeData() seems to be unnatural in the processor when there is a Persistence class. I did not change that.

Use this pull request as you like, partially or fully, or just throwing it out. I mainly did this to learn a bit from the code, and although I wrote a few annotation providers (two to be specific), I learned a lot from your code about annotation processors and coding. It was really refreshing to work on some code that is a good quality in the abstractions. Every day I review and fix code created by juniors or mediocre developers who do not care.

@aalmiray
Copy link
Collaborator

Thank you for your contribution! I can take credit for the cod,e it comes mostly from the MangoSDK project by the Lombok authors, which is why the codebase looks old (pre Java 8).

There are some interesting bits in this contribution however I'd split it in smaller PRs such as:

  • only javadoc updates
  • internal refactoring (no method signature changes)
  • breaking refactoring (signature & class changes). These break the Griffon processors (http://github.com/griffon/griffon)

Could you break down the contribution into smaller chunks? Thanks!

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

Successfully merging this pull request may close these issues.

2 participants