Skip to content

IllegalInstantiation: make all tokens should be required, so no need to use custom values in tokens property #3955

@rnveach

Description

@rnveach

http://checkstyle.sourceforge.net/config_coding.html#IllegalInstantiation

tokens to check subset of tokens CLASS_DEF.

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 what CLASS_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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions