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
IllegalInstantiation: make all tokens should be required, so no need to use custom values in tokens property #3955
Comments
Can you please specify what exactly I need to do. |
Starting with bb1db49 , Also to note in b0c3377 , a comment existed that specifically said "to not allow user to change configuration" for acceptable tokens. Meaning this didn't look to be intended that any customization of tokens was the design at the time. It was changed in 69e5f93 . Tokens like this, where a single token is listed in the acceptable and default required documentation tables can be "removed". The only way to do this is to define properties as the list of required tokens (Example below). This bypasses any checks and uses this instead of the default. Required tokens are always added by default anyways. Empty token property is always ignored. The required tokens for this check are The Example.
Behavior with
Notice the validation of the file with the Edit:
Discussion started at #9181 (comment) |
IMO, this is a bug and I did want to also mention that JavadocVariable, and ImportOrder are similar looking checks that will need to be examined as well. |
If all approve at #12108, we need to update issue description for release notes, it does not accurately describe changes there. |
This is not breaking compatibility as all previous variations of config continue to work as before. Behavior changed a bit. |
Fix is merged |
http://checkstyle.sourceforge.net/config_coding.html#IllegalInstantiation
Usage of this token was to let users to skip local classes.
But
classes
allow to specify fully qualified name to exclude, local/nested classes also have fully qualified name. So all can be covered to make CLASS_DEF to be used all times, and let use play with classes only.There are no examples or explanation from whatCLASS_DEF
gives you in this check.It is enabled by default, but what happens if you disable it, if its possible. It is also not clear how it can be disabled in configuration, which I assume involves setting the property to an empty string.
We also have no tests showing what turning
CLASS_DEF
off does differently.We should examine what this token does, if it should remain optional, and update the xdoc based on the findings.
User Migration
As all tokens were made required, users can either remove the
tokens
property for IllegalInstantiation. Leaving it alone will also have no side effects as there is no way to override required tokens.The text was updated successfully, but these errors were encountered: