Skip to content

Make PrivateConstructorForUtilityClass pass for non-exported class with main method #5726

@anthonyvdotbe

Description

@anthonyvdotbe

Given a class with a main method and without instance methods:

when:

  • either the class is within a module and is either non-public or not in an exported package
  • or the class is not within a module and is non-public

and all static methods other than the main method, if any, are private,

then the check should pass.

The check is useful, so I want to enable it, but to me the above case qualifies as a false positive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions