From ff76382210d8f4b7a906d7dbd3f07cdd4f4bea8d Mon Sep 17 00:00:00 2001 From: tsantalis Date: Thu, 16 Jan 2025 09:09:34 -0500 Subject: [PATCH] Improved solution over previous commit --- .../uom/java/xmi/decomposition/UMLOperationBodyMapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 0b0b946fc..c9330e5e7 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java @@ -3524,6 +3524,9 @@ public void computeRefactoringsWithinBody() throws RefactoringMinerTimedOutExcep assertThrowsCalls.add(call); for(AbstractCodeMapping mapping : this.mappings) { if(call.getLocationInfo().subsumes(mapping.getFragment2().getLocationInfo()) || mapping.getFragment2().getLocationInfo().subsumes(call.getLocationInfo())) { + if(parentMapper != null && parentMapper.getMappings().contains(mapping)) { + continue; + } if(assertThrowsMappings.containsKey(call.actualString())) { assertThrowsMappings.get(call.actualString()).add(mapping); } @@ -8982,7 +8985,7 @@ private void processAnonymousClassDeclarationsInIdenticalStatements(LeafMapping this.nonMappedInnerNodesT2.addAll(mapper.nonMappedInnerNodesT2); this.nonMappedLeavesT1.addAll(mapper.nonMappedLeavesT1); this.nonMappedLeavesT2.addAll(mapper.nonMappedLeavesT2); - if(this.container1 != null && this.container2 != null && !lambda1.getString().equals(lambda2.getString())) { + if(this.container1 != null && this.container2 != null) { this.refactorings.addAll(mapper.getRefactorings()); } }