Back to Intellij Community

ForwardCompatibility

java/java-impl/resources/inspectionDescriptions/ForwardCompatibility.html

2025.3-rc-2653 B
Original Source

Reports Java code constructs that may fail to compile in future Java versions.

The following problems are reported:

  • Uses of assert, enum or _ as an identifier
  • Uses of the var, yield, or record restricted identifier as a type name
  • Unqualified calls to methods named yield
  • Modifiers on the requires java.base statement inside of module-info.java
  • Redundant semicolons between import statements

Example:

// This previously legal class does not compile with Java 14,
  // as 'yield' became a restricted identifier.
  public class yield {}

Fixing these issues timely may simplify migration to future Java versions.