google / google/error-prone

`DefaultPackage` emitted for compact source files.

Open
#5,577 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.