File: PackageLocation.md

package info (click to toggle)
error-prone-java 2.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 23,204 kB
  • sloc: java: 222,992; xml: 1,319; sh: 25; makefile: 7
file content (20 lines) | stat: -rw-r--r-- 664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Java files should be located in a directory that
ends with the fully qualified name of the package.

For example, classes in the package `edu.oswego.cs.dl.util.concurrent` should be
located in: `.../edu/oswego/cs/dl/util/concurrent`.

## Suppression

If necessary, the check may be suppressed by annotating the enclosing package
declaration with `@com.google.errorprone.annotations.SuppressPackageLocation`,
for example:

```java
// package-info.java
@com.google.errorprone.annotations.SuppressPackageLocation
package com.google.my.pkg;
```

Note that package annotations must be located in a `package-info.java` file that
must be built together with the package.