Skip to content

DefaultPackage emitted for compact source files. #5577

@SLUCHABLUB

Description

@SLUCHABLUB

The DefaultPackage warning gets emitted for compact source files.

/my/project/app/src/main/java/Main.java:1: warning: [DefaultPackage] Java classes shouldn't use default package
public static final void main() {}
^
    (see https://errorprone.info/bugpattern/DefaultPackage)

This feels wrong to me since compact source files by design put their implicitly defined class in the unnamed (default) package. It the intention is to dissuade the use of compact source files as well, then I think it should be part of a different warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions