diff --git a/src/main/java/gr/uom/java/xmi/decomposition/ReplacementAlgorithm.java b/src/main/java/gr/uom/java/xmi/decomposition/ReplacementAlgorithm.java index 051e3d870..152571e6a 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/ReplacementAlgorithm.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/ReplacementAlgorithm.java @@ -4733,7 +4733,7 @@ else if(anonymousClassDeclarations1.size() == 1 && anonymousClassDeclarations2.s operationBodyMapper.getNonMappedLeavesT1().addAll(mapper.getNonMappedLeavesT1()); operationBodyMapper.getNonMappedLeavesT2().addAll(mapper.getNonMappedLeavesT2()); if(operationBodyMapper.getContainer1() != null && operationBodyMapper.getContainer2() != null) { - ReplaceAnonymousWithLambdaRefactoring ref = new ReplaceAnonymousWithLambdaRefactoring(anonymousClass1, lambda2, container1, container2); + ReplaceAnonymousWithLambdaRefactoring ref = new ReplaceAnonymousWithLambdaRefactoring(anonymousClass1, lambda2, container1, container2, mapper.getMappings()); operationBodyMapper.getRefactoringsAfterPostProcessing().add(ref); operationBodyMapper.getRefactoringsAfterPostProcessing().addAll(mapper.getRefactorings()); } diff --git a/src/main/java/gr/uom/java/xmi/diff/ReplaceAnonymousWithLambdaRefactoring.java b/src/main/java/gr/uom/java/xmi/diff/ReplaceAnonymousWithLambdaRefactoring.java index c830fb1db..e4c6ddcfa 100644 --- a/src/main/java/gr/uom/java/xmi/diff/ReplaceAnonymousWithLambdaRefactoring.java +++ b/src/main/java/gr/uom/java/xmi/diff/ReplaceAnonymousWithLambdaRefactoring.java @@ -11,6 +11,7 @@ import gr.uom.java.xmi.UMLAnonymousClass; import gr.uom.java.xmi.VariableDeclarationContainer; +import gr.uom.java.xmi.decomposition.AbstractCodeMapping; import gr.uom.java.xmi.decomposition.LambdaExpressionObject; public class ReplaceAnonymousWithLambdaRefactoring implements Refactoring { @@ -18,13 +19,15 @@ public class ReplaceAnonymousWithLambdaRefactoring implements Refactoring { private LambdaExpressionObject lambda; private VariableDeclarationContainer operationBefore; private VariableDeclarationContainer operationAfter; + private Set mappings; public ReplaceAnonymousWithLambdaRefactoring(UMLAnonymousClass anonymousClass, LambdaExpressionObject lambda, - VariableDeclarationContainer operationBefore, VariableDeclarationContainer operationAfter) { + VariableDeclarationContainer operationBefore, VariableDeclarationContainer operationAfter, Set mappings) { this.anonymousClass = anonymousClass; this.lambda = lambda; this.operationBefore = operationBefore; this.operationAfter = operationAfter; + this.mappings = mappings; } public UMLAnonymousClass getAnonymousClass() { @@ -43,6 +46,10 @@ public VariableDeclarationContainer getOperationAfter() { return operationAfter; } + public Set getMappings() { + return mappings; + } + @Override public List leftSide() { List ranges = new ArrayList();