레코드 클래스를 보고하고 이를 일반 클래스로 변환하도록 제안합니다.

이 검사는 이 레코드에 빠른 수정을 적용하여 Java 레코드를 이전 Java 버전을 사용하는 코드 베이스로 이동 가능하게 합니다.

참고로, 결과로 얻어진 클래스는 기존 레코드와 완전히 똑같지는 않습니다.

예:


  record Point(int x, int y) {}

빠른 수정을 적용한 후:


  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 + ']';
    }
  }

2020.3의 새로운 기능