Reports the Java code constructs that may fail to compile in future Java versions.
The following problems are reported:
- Use of 'assert', 'enum' or '_' as an identifier
- Use of restricted identifier 'var', 'yield', or 'record' as a type name
- Unqualified calls to method named 'yield'
- Modifiers on 'requires java.base' statement inside module-info.java
Example:
// Since Java 14, this class will stop compiling, as 'yield' becomes a restricted identifier.
public class yield {}
Fixing these issues timely may simplify migration to future Java versions.