Nothing in its file refers to a private nested type
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.
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(); }} 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:
[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.