Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract and Move Method in Rename Method instance #23

Open
osmarleandro opened this issue Feb 4, 2021 · 0 comments
Open

Extract and Move Method in Rename Method instance #23

osmarleandro opened this issue Feb 4, 2021 · 0 comments

Comments

@osmarleandro
Copy link

Summary

In the source code present in osmarleandro/RefactoringMiner@00d45e1 commit, I applied a single Rename Method to isFinal() method in UMLAttribute class, but RefDiff yields Extract and Move Method instance.

Code example

Diff fragment between the commit osmarleandro/RefactoringMiner@00d45e1 and their parent.

@@ -45,7 +45,7 @@ public class UMLAttribute implements Comparable<UMLAttribute>, Serializable, Loc
                this.visibility = visibility;
        }
 
-       public boolean isFinal() {
+       public boolean isFinal_RENAMED() {
                return isFinal;
        }

@@ -42,7 +42,7 @@ public class UMLAttributeDiff {
                        qualifiedTypeChanged = true;
                if(removedAttribute.isStatic() != addedAttribute.isStatic())
                        staticChanged = true;
-               if(removedAttribute.isFinal() != addedAttribute.isFinal())
+               if(removedAttribute.isFinal_RENAMED() != addedAttribute.isFinal_RENAMED())

@@ -89,8 +89,8 @@ public class UMLAttributeDiff {
                        sb.append("\t").append("modifier changed from " + (removedAttribute.isStatic() ? "static" : "non-static") + " to " +
                                        (addedAttribute.isStatic() ? "static" : "non-static")).append("\n");
                if(finalChanged)
-                       sb.append("\t").append("modifier changed from " + (removedAttribute.isFinal() ? "final" : "non-final") + " to " +
-                                       (addedAttribute.isFinal() ? "final" : "non-final")).append("\n");
+                       sb.append("\t").append("modifier changed from " + (removedAttribute.isFinal_RENAMED() ? "final" : "non-final") + " to " +
+                                       (addedAttribute.isFinal_RENAMED() ? "final" : "non-final")).append("\n");

Environment details

RefDiff 2.0

Steps to reproduce

  1. Run RefDiff and give as input the commit osmarleandro/RefactoringMiner@00d45e1.

Actual results

EXTRACT_MOVE	{Method toString() at src/gr/uom/java/xmi/diff/UMLAttributeDiff.java:78}	{Method isFinal_RENAMED() at src/gr/uom/java/xmi/UMLAttribute.java:48})

Expected results

A single instance of the Rename Method refactoring applied to isFinal() method in UMLAttribute class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant