Skip to content

Migrate new "Replace deprecated field" QuickFix from jdt.ui #3626

@datho7561

Description

@datho7561

See eclipse-jdt/eclipse.jdt.ui#2254

Jeff added a new QuickFix to jdt.ui that replaces a reference to a deprecated field with another field that's referenced in the Javadoc. For example if you have:

public class MyClass {
  /**
   * @deprecated use {@link MyClass#REAL_VALUE} instead
   */
  @Deprecated
  public static int VALUE = 12;
  public static int REAL_VALUE = 12;
}

And you reference VALUE in a different class:

public class MyOtherClass {
  public static void main(String... args) {
    System.out.println(MyClass.VALUE);
  }
}

There should be a warning, and there should be an option to resolve the warning called "Replace deprecated field" that replaces VALUE with REAL_VALUE.

We should be able to add this QuickFix into eclipse.jdt.ls with a bit of work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions