Missing Inline Variable refactoring
Hello! I noticed that RefactoringMiner doesn't detect Inline Variable refactoring at the following code changes:
Before:
public String getName() {
String name = "A";
return name;
}
After:
public String getName() {
return "A";
}
RefactoringMiner version: 2.0.3
In this case String name = "A"; is matched with return "A"; instead of
return name; -> return "A"; +
Inline Variable
String name = "A";
A similar scenario for Extract Variable holds in case
https://github.com/javaparser/javaparser/commit/427dd53b9ebedcb0bdb687007eb0faf2de734df4#diff-d4545a64b742a6d7b072135d10643c1d309ecaa62daa9450ba05dc68985543aaR477
where
final VariableDeclarator variableDeclarator = (VariableDeclarator)type.getParentNode().get(); is matched with
Node parent = type.getParentNode().get();
instead of
final VariableDeclarator variableDeclarator = (VariableDeclarator)type.getParentNode().get(); ->
final VariableDeclarator variableDeclarator = (VariableDeclarator) parent; +
Extract Variable
Node parent = type.getParentNode().get();
@onewhl This old issue is fixed.