Suggests to replace records with ordinary classes. The inspection could be useful if you need to move a Java record to codebases that use earlier Java versions.

Note that the resulting class is not completely equivalent to the original record:

Example:

  record Point(int x, int y) {}
This record will be converted to
  final class Point {
    private final int x;
    private final int y;

    Point(int x, int y) {
      this.x = x;
      this.y = y;
    }

    public int x() {
      return x;
    }

    public int y() {
      return y;
    }

    @Override
    public boolean equals(Object obj) {
      if (obj == this) return true;
      if (obj == null || obj.getClass() != this.getClass()) return false;
      var that = (Point) obj;
      return this.x == that.x &&
              this.y == that.y;
    }

    @Override
    public int hashCode() {
      return Objects.hash(x, y);
    }

    @Override
    public String toString() {
      return "Point[" +
              "x=" + x + ", " +
              "y=" + y + ']';
    }
  }

This inspection only applies to language level 14 preview and 15 preview.

New in 2020.3