From 0a4a83b8ffc7b09b1676c6c81f98b85bc4b6650f Mon Sep 17 00:00:00 2001 From: tsantalis Date: Thu, 2 Jan 2025 11:39:44 -0500 Subject: [PATCH] Avoid incorrect Extract and Move Method in commit https://github.com/junit-team/junit4/commit/aad22b88bf3332cf304da6f558152b59cdbeea2b public getOrderedRules() : List extracted from protected classRules() : List in class org.junit.runners.ParentRunner & moved to class org.junit.runners.ParentRunner.ClassRuleCollector --- .../uom/java/xmi/decomposition/UMLOperationBodyMapper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java index b6776126c..9116d71e3 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java @@ -3610,6 +3610,11 @@ public boolean containsOnlyBlockMappings() { if(mapping.getFragment1().getLocationInfo().getCodeElementType().equals(CodeElementType.BLOCK) && mapping.getFragment2().getLocationInfo().getCodeElementType().equals(CodeElementType.BLOCK)) { count++; } + else if(mapping.getFragment1().getVariables().size() == 1 && mapping.getFragment2().getVariables().size() == 1 && + mapping.getFragment1().getString().equals(JAVA.RETURN_SPACE + mapping.getFragment1().getVariables().get(0).getString() + JAVA.STATEMENT_TERMINATION) && + mapping.getFragment2().getString().equals(JAVA.RETURN_SPACE + mapping.getFragment2().getVariables().get(0).getString() + JAVA.STATEMENT_TERMINATION)) { + count++; + } } return count > 0 && count == getMappings().size(); }