Search code examples
javaabstract-syntax-treeeclipse-jdt

How to rename field using jdt


Public class RenameClass{
    private static final String TITLE= "title";
    Public static void main(String [] args){
    System.out.println(TITLE)
   }

}

By using jdt, I want to remove the field and in place of TITLE I want to rename with the value.... I want to rename like below:

Public class RenameClass{
    Public static void main(String [] args){
    System.out.println("title")
   }

}

Please provide any reference or source for implementation.


Solution

  • You seem to be looking for the existing Inline Constant refactoring.

    Not to be confused with Rename refactorings, btw.