Nothing in its file refers to a private nested type

tx0/java:dead-private-typerecommendedwarningsmell

What it finds

A private nested class, interface, enum or record that nothing in its file mentions can never be used, since nothing outside the file can see it.

A type counts as used when its name occurs anywhere else in the file, as an identifier or as the whole of a string literal. Types with annotations are left alone.

From the rule's source, unused_private_type.rs.

Example from the rule's tests
class Outer {  private static class Used {}  private static class Forgotten {}tx0 reports: the private type Forgotten is never used  private enum Mode { ON }tx0 reports: the private type Mode is never used  static class Visible {}   Used make() {    return new Used();  }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:dead-private-type" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:dead-private-type] reason="..."

tx0 explain tx0/java:dead-private-type shows the same in the terminal. Found a false positive? Report it.