Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Improve main #6053
base: master
Are you sure you want to change the base?
Improve main #6053
Changes from all commits
b83aa4a
9c93ad9
506c414
cea72a7
d3d535f
27629dd
f0f068a
51742e3
2807705
7dc84a2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My IDE reports: "Such code might indicate an error or an incorrect assumption about the effect of the final keyword. Static methods are not subject to runtime polymorphism, so the only purpose of the final keyword used with static methods is to ensure the method will not be hidden in a subclass."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I once did read that one should make all methods used in the constructor final, because if they are overloaded in a subclass, it could have confusing effects. I always do that; if the methods are under the constructor, you can see nicely in the “outline” what belongs to the constructors and where the actual class begins. For me, that is an improvement in the clarity of the code. In this case, it is particularly exciting because the “constructor” is not a constructor in the Java sense, but a method that is called by the Servlet Container to construct the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced having a structure outline in your IDE that you find more intuitive is a good enough reason to overrule this formal recommendation, but I can live with it if you really think it helps you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this method? My IDE shows it is unused, and the two interfaces that this method implements do not seem to require the method either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a getter. You might want to get the servlet context to get the application's working directory, for example, or the server version. It's here for convenience. At the moment, it's not used yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the method if it's unused and not required at the moment. Doesn't matter if it's just a getter. It should be added if required in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is my idea that the main class of the application also provides essential characteristics of the application via getters. The manifest is such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unused getters if they are not technically required, see above.