Skip to content

Commit 1ea7655

Browse files
committed
Enable detection of Extract and Move Method refactoring in commit
elastic/elasticsearch@b3bcc81 TransformRestTestCase extends TransformCommonRestTestCase TransformCommonRestTestCase extends ESRestTestCase extracted method is moved to ESRestTestCase and it is indirectly inherited by TransformRestTestCase
1 parent 25077ff commit 1ea7655

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ As of **November 2, 2025** the precision and recall of RefactoringMiner on this
507507

508508
| Refactoring Type | TP | FP | FN | Precision | Recall |
509509
|:-----------------------|-----------:|--------:|--------:|--------:|--------:|
510-
|**Total**|3416 | 50 | 117 | 0.986 | 0.967|
510+
|**Total**|3417 | 50 | 116 | 0.986 | 0.967|
511511
|Extract Method|371 | 1 | 4 | 0.997 | 0.989|
512512
|Rename Class|232 | 1 | 2 | 0.996 | 0.991|
513513
|Move Attribute|72 | 0 | 7 | 1.000 | 0.911|
@@ -526,7 +526,7 @@ As of **November 2, 2025** the precision and recall of RefactoringMiner on this
526526
|Extract Superclass| 8 | 0 | 0 | 1.000 | 1.000|
527527
|Extract Subclass| 8 | 0 | 0 | 1.000 | 1.000|
528528
|Extract Class|45 | 1 | 4 | 0.978 | 0.918|
529-
|Extract And Move Method|122 | 2 | 6 | 0.984 | 0.953|
529+
|Extract And Move Method|123 | 2 | 5 | 0.984 | 0.961|
530530
|Move And Inline Method|29 | 1 | 6 | 0.967 | 0.829|
531531
|Replace Anonymous With Class| 5 | 0 | 0 | 1.000 | 1.000|
532532
|Extract Variable|289 | 1 | 11 | 0.997 | 0.963|

src/main/java/gr/uom/java/xmi/decomposition/OperationInvocation.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ else if((parentFieldDeclarationMap != null && parentFieldDeclarationMap.contains
472472
if(classDiff != null && classDiff.getNextClass().importsType(operation.getClassName() + "." + operation.getName())) {
473473
return true;
474474
}
475+
if(classDiff != null && classDiff.getNextClass().getSuperclass() != null && modelDiff != null) {
476+
UMLClassBaseDiff superClassDiff = modelDiff.getUMLClassDiff(classDiff.getNextClass().getSuperclass());
477+
if(superClassDiff != null && superClassDiff.getNextClass().importsType(operation.getClassName())) {
478+
return true;
479+
}
480+
}
475481
return callerOperation.getClassName().equals(operation.getClassName()) || callerOperation.getClassName().startsWith(operation.getClassName());
476482
}
477483
}

src/test/java/org/refactoringminer/test/TestNewDatasetRefactorings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public void testAllRefactorings() throws Exception {
5050
.or(Refactorings.ReplaceAttributeWithVariable.getValue());
5151
TestBuilder test = new TestBuilder(detector, REPOS, types);
5252
RefactoringPopulator.feedTSERefactoringInstances(test);
53-
test.assertExpectationsWithGitHubAPI(3416, 50, 117);
53+
test.assertExpectationsWithGitHubAPI(3417, 50, 116);
5454
}
5555
}

0 commit comments

Comments
 (0)