A declaration is named with a word that later Java versions made a keyword

tx0/java:contextual-keyword-namestrictwarningsmell

What it finds

var, yield, record, sealed, permits and when became keywords in some places of the language after Java 8, and stay names everywhere else. Code that declares a variable, method or field with one of them is confusing to read, and some uses stop compiling: a method named yield cannot be called without a qualifier, and a type named var or record cannot be declared at all.

From the rule's source, keyword_as_name.rs.

Example from the rule's tests
class Records {  int record;tx0 reports: record is a keyword in parts of the language   void yield() {}tx0 reports: yield is a keyword   void read() {    var value = 1;    int var = value;tx0 reports: var is a keyword  }}
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 strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:contextual-keyword-name" = "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:contextual-keyword-name] reason="..."

tx0 explain tx0/java:contextual-keyword-name shows the same in the terminal. Found a false positive? Report it.