From 635a67e85a818d3d5e1f462f10a39d286272e805 Mon Sep 17 00:00:00 2001 From: tsantalis Date: Thu, 26 Dec 2024 06:05:14 -0500 Subject: [PATCH] Adapt trackers to RMiner API changes --- .../java/org/codetracker/AnnotationTrackerChangeHistory.java | 5 ++--- src/main/java/org/codetracker/BlockTrackerChangeHistory.java | 4 ++-- .../java/org/codetracker/CommentTrackerChangeHistory.java | 5 ++--- .../java/org/codetracker/VariableTrackerChangeHistory.java | 2 +- src/test/resources/blame/blameTestWithLocalRepo21.txt | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/codetracker/AnnotationTrackerChangeHistory.java b/src/main/java/org/codetracker/AnnotationTrackerChangeHistory.java index 62678181e75..d92eed983d3 100644 --- a/src/main/java/org/codetracker/AnnotationTrackerChangeHistory.java +++ b/src/main/java/org/codetracker/AnnotationTrackerChangeHistory.java @@ -22,7 +22,6 @@ import gr.uom.java.xmi.UMLAnnotation; import gr.uom.java.xmi.UMLAttribute; import gr.uom.java.xmi.UMLEnumConstant; -import gr.uom.java.xmi.UMLOperation; import gr.uom.java.xmi.VariableDeclarationContainer; import gr.uom.java.xmi.decomposition.UMLOperationBodyMapper; import gr.uom.java.xmi.diff.AddAttributeAnnotationRefactoring; @@ -485,8 +484,8 @@ private boolean isAdded(Pair equalMethod, Annotation rightAnnotation, List refactorings) { for (Refactoring refactoring : refactorings) { - UMLOperation operationBefore = null; - UMLOperation operationAfter = null; + VariableDeclarationContainer operationBefore = null; + VariableDeclarationContainer operationAfter = null; UMLOperationBodyMapper umlOperationBodyMapper = null; switch (refactoring.getRefactoringType()) { case PULL_UP_OPERATION: { diff --git a/src/main/java/org/codetracker/BlockTrackerChangeHistory.java b/src/main/java/org/codetracker/BlockTrackerChangeHistory.java index af4e1de00e2..52dd3fb54ae 100644 --- a/src/main/java/org/codetracker/BlockTrackerChangeHistory.java +++ b/src/main/java/org/codetracker/BlockTrackerChangeHistory.java @@ -1311,8 +1311,8 @@ private boolean isAdded(UMLOperationBodyMapper umlOperationBodyMapper, Version c public boolean checkRefactoredMethod(Version currentVersion, Version parentVersion, Predicate equalMethod, Block rightBlock, List refactorings) { for (Refactoring refactoring : refactorings) { - UMLOperation operationBefore = null; - UMLOperation operationAfter = null; + VariableDeclarationContainer operationBefore = null; + VariableDeclarationContainer operationAfter = null; UMLOperationBodyMapper umlOperationBodyMapper = null; switch (refactoring.getRefactoringType()) { case PULL_UP_OPERATION: { diff --git a/src/main/java/org/codetracker/CommentTrackerChangeHistory.java b/src/main/java/org/codetracker/CommentTrackerChangeHistory.java index 908fb6a3873..e16d0664716 100644 --- a/src/main/java/org/codetracker/CommentTrackerChangeHistory.java +++ b/src/main/java/org/codetracker/CommentTrackerChangeHistory.java @@ -32,7 +32,6 @@ import com.github.difflib.patch.InsertDelta; import com.github.difflib.patch.Patch; -import gr.uom.java.xmi.UMLOperation; import gr.uom.java.xmi.VariableDeclarationContainer; import gr.uom.java.xmi.LocationInfo.CodeElementType; import gr.uom.java.xmi.UMLAnonymousClass; @@ -806,8 +805,8 @@ private boolean isAdded(UMLAbstractClassDiff classDiff, Version currentVersion, public boolean checkRefactoredMethod(Version currentVersion, Version parentVersion, Predicate equalMethod, Comment rightComment, List refactorings) { for (Refactoring refactoring : refactorings) { - UMLOperation operationBefore = null; - UMLOperation operationAfter = null; + VariableDeclarationContainer operationBefore = null; + VariableDeclarationContainer operationAfter = null; UMLOperationBodyMapper umlOperationBodyMapper = null; switch (refactoring.getRefactoringType()) { case PULL_UP_OPERATION: { diff --git a/src/main/java/org/codetracker/VariableTrackerChangeHistory.java b/src/main/java/org/codetracker/VariableTrackerChangeHistory.java index f25897017da..985d343aadd 100644 --- a/src/main/java/org/codetracker/VariableTrackerChangeHistory.java +++ b/src/main/java/org/codetracker/VariableTrackerChangeHistory.java @@ -512,7 +512,7 @@ private Set analyseVariableRefactorings(Collection refact public boolean checkRefactoredMethod(Version currentVersion, Version parentVersion, Predicate equalMethod, Variable rightVariable, List refactorings) { for (Refactoring refactoring : refactorings) { - UMLOperation operationAfter = null; + VariableDeclarationContainer operationAfter = null; UMLOperationBodyMapper umlOperationBodyMapper = null; switch (refactoring.getRefactoringType()) { case PULL_UP_OPERATION: { diff --git a/src/test/resources/blame/blameTestWithLocalRepo21.txt b/src/test/resources/blame/blameTestWithLocalRepo21.txt index 36398535186..a86644e7b3e 100644 --- a/src/test/resources/blame/blameTestWithLocalRepo21.txt +++ b/src/test/resources/blame/blameTestWithLocalRepo21.txt @@ -1305,7 +1305,7 @@ e0a5913f8 pmd/src/net/sourceforge/pmd/lang/java/typeresolution/ClassTypeResolver 6215d97b9 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2006-10-26 02:35:38 +0000 1305) } 6215d97b9 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2006-10-26 02:35:38 +0000 1306) if (qualifiedName != null) { 6215d97b9 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2006-10-26 02:35:38 +0000 1307) try { -6215d97b9 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2006-10-26 02:35:38 +0000 1308) /* +881218544 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2007-02-03 12:48:12 +0000 1308) /* 881218544 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2007-02-03 12:48:12 +0000 1309) * TODO - the map right now contains just class names. if we 881218544 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2007-02-03 12:48:12 +0000 1310) * use a map of classname/class then we don't have to hit 881218544 pmd/src/net/sourceforge/pmd/typeresolution/ClassTypeResolver.java (Allan Caplan 2007-02-03 12:48:12 +0000 1311) * the class loader for every type - much faster