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
added hidden field ignore rule for builder setter methods #260
Conversation
|
updated the main pull request top comment |
That for description ,now It see clearly what is your intend.
you missed that point to fix.
Why you think that with set and with are the only names that could be used in Builder, see link above? |
Ok, to have more flexibility over the configuration only makes sense. But a bit more work will be required then. Now, in order to accommodate the required features, instead of a new
Let me know what you think. |
@wigbam , looks closer to true but ..... Lets come back to original problem. You have problem with setter recognition, so you need to have option that allow you to specify what prefix should mark method as "setter". term "setter" is highly debatable in Java - it is up to a user , what is setter and what is not. So I think that just implementing setterPrefixRegex will be enough. do you follow me ? |
@romani, not really, the original problem was to do with Checkstyle's expectation for setters to return |
@wigbam, you are right, let me think about it one more time. |
@wigbam, one more idea: So option could be : Does it make sense ? |
Hi All. But isn't it is common to have setters in the form
in classes that do not nessesaerly named ".*Builder$"? I would say that if method satisfy following rules:
Then such method should be considered a setter. However in order to maintain backward
to the HiddenField module. |
PR is closed , discussion is moved to mail-list https://groups.google.com/d/msg/checkstyle-devel/aPNYF3RC_yU/lGHsgRPCO38J |
Currently
HiddenField
module has an option to ignore only simple setter methods returningvoid
. Assume thecheckstyle.cfg
has the following:Then this source file would be flagged:
The proposed improvement is to add another boolean property 'ignoreBuilderSetter' to
HiddenField
module which would for all types named as.*Builder
allow to ignore setter methods named eitherwithX
orsetX
and returning the defining type.See committed xdoc for details.