From 8db9766bd84d6ef7bbe4c2e6f3dc9b6789a7cab7 Mon Sep 17 00:00:00 2001 From: tsantalis Date: Fri, 11 Oct 2019 10:46:24 -0400 Subject: [PATCH] Additional changes for issue #70 --- .../manipulators/ExtractMethodFragmentRefactoring.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gr/uom/java/jdeodorant/refactoring/manipulators/ExtractMethodFragmentRefactoring.java b/src/gr/uom/java/jdeodorant/refactoring/manipulators/ExtractMethodFragmentRefactoring.java index 9d0a816b..afc7498a 100644 --- a/src/gr/uom/java/jdeodorant/refactoring/manipulators/ExtractMethodFragmentRefactoring.java +++ b/src/gr/uom/java/jdeodorant/refactoring/manipulators/ExtractMethodFragmentRefactoring.java @@ -338,7 +338,7 @@ else if(controlDependence.isFalseControlDependence()) { PDGControlPredicateNode dstPredicateNode = (PDGControlPredicateNode)dstPDGNode; listRewrite.insertLast(processPredicateNode(dstPredicateNode, ast, sourceRewriter, sliceNodes), null); } - else { + else if(!tryStatementBodyRewriteMap.containsKey(dstPDGNode.getASTStatement())) { processStatementNode(listRewrite, dstPDGNode, ast, sourceRewriter); sliceNodes.remove(dstPDGNode); } @@ -366,7 +366,7 @@ else if(trueControlDependentChildren.size() == 1) { PDGControlPredicateNode dstPredicateNode = (PDGControlPredicateNode)dstPDGNode; listRewrite.insertLast(processPredicateNode(dstPredicateNode, ast, sourceRewriter, sliceNodes), null); } - else { + else if(!tryStatementBodyRewriteMap.containsKey(dstPDGNode.getASTStatement())) { processStatementNode(listRewrite, dstPDGNode, ast, sourceRewriter); sliceNodes.remove(dstPDGNode); } @@ -404,7 +404,7 @@ else if(oldPredicateStatement instanceof SwitchStatement) { PDGControlPredicateNode dstPredicateNode = (PDGControlPredicateNode)dstPDGNode; bodyRewrite.insertLast(processPredicateNode(dstPredicateNode, ast, sourceRewriter, sliceNodes), null); } - else { + else if(!tryStatementBodyRewriteMap.containsKey(dstPDGNode.getASTStatement())) { processStatementNode(bodyRewrite, dstPDGNode, ast, sourceRewriter); sliceNodes.remove(dstPDGNode); }