Skip to content

Commit

Permalink
Fix for issue #399
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Apr 10, 2023
1 parent 8d41ce1 commit 1050c28
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -7696,8 +7696,8 @@ else if(invokedOperationsAfter != null && invokedOperationsAfter.size() > 0) {
if(invocationCoveringTheEntireStatement1 != null && invocationCoveringTheEntireStatement2 != null &&
variableDeclarations1.size() > 0 && variableDeclarations1.toString().equals(variableDeclarations2.toString()) &&
invocationCoveringTheEntireStatement1.variableDeclarationInitializersRenamedWithIdenticalArguments(invocationCoveringTheEntireStatement2)) {
Replacement replacement = new MethodInvocationReplacement(invocationCoveringTheEntireStatement1.getName(),
invocationCoveringTheEntireStatement2.getName(), invocationCoveringTheEntireStatement1, invocationCoveringTheEntireStatement2, ReplacementType.METHOD_INVOCATION_NAME_AND_EXPRESSION);
Replacement replacement = new MethodInvocationReplacement(invocationCoveringTheEntireStatement1.actualString(),
invocationCoveringTheEntireStatement2.actualString(), invocationCoveringTheEntireStatement1, invocationCoveringTheEntireStatement2, ReplacementType.METHOD_INVOCATION_NAME_AND_EXPRESSION);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
Expand Down Expand Up @@ -8074,8 +8074,8 @@ else if(operationInvocation1.inlinedStatementBecomesAdditionalArgument(invocatio
}
}
}
Replacement replacement = new ObjectCreationReplacement(creation1.getName(),
creationCoveringTheEntireStatement2.getName(), (ObjectCreation)creation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
Replacement replacement = new ObjectCreationReplacement(creation1.actualString(),
creationCoveringTheEntireStatement2.actualString(), (ObjectCreation)creation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
Expand Down Expand Up @@ -8138,7 +8138,7 @@ else if(operationInvocation1.inlinedStatementBecomesAdditionalArgument(invocatio
replacementInfo.addReplacement(composite);
}
else {
Replacement replacement = new MethodInvocationReplacement(invocationCoveringTheEntireStatement1.getName(), invocationCoveringTheEntireStatement2.getName(),
Replacement replacement = new MethodInvocationReplacement(invocationCoveringTheEntireStatement1.actualString(), invocationCoveringTheEntireStatement2.actualString(),
invocationCoveringTheEntireStatement1, invocationCoveringTheEntireStatement2, ReplacementType.METHOD_INVOCATION);
replacementInfo.addReplacement(replacement);
}
Expand Down Expand Up @@ -8202,7 +8202,7 @@ else if(operationInvocation1.inlinedStatementBecomesAdditionalArgument(invocatio
replacementInfo.addReplacement(composite);
}
else {
Replacement replacement = new MethodInvocationReplacement(invocationCoveringTheEntireStatement1.getName(), invocationCoveringTheEntireStatement2.getName(),
Replacement replacement = new MethodInvocationReplacement(invocationCoveringTheEntireStatement1.actualString(), invocationCoveringTheEntireStatement2.actualString(),
invocationCoveringTheEntireStatement1, invocationCoveringTheEntireStatement2, ReplacementType.METHOD_INVOCATION);
replacementInfo.addReplacement(replacement);
}
Expand Down Expand Up @@ -8241,8 +8241,8 @@ else if(operationInvocation1.inlinedStatementBecomesAdditionalArgument(invocatio
creationCoveringTheEntireStatement2.getType().getClassType().endsWith("Exception")) {
Set<String> argumentIntersection = creationCoveringTheEntireStatement1.argumentIntersection(creationCoveringTheEntireStatement2);
if(argumentIntersection.size() > 0 && argumentIntersection.size() == Math.min(creationCoveringTheEntireStatement1.arguments().size(), creationCoveringTheEntireStatement2.arguments().size())) {
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.getName(),
creationCoveringTheEntireStatement2.getName(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION);
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.actualString(),
creationCoveringTheEntireStatement2.actualString(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
Expand All @@ -8256,8 +8256,8 @@ else if(operationInvocation1.inlinedStatementBecomesAdditionalArgument(invocatio
parent2 = parent2.getParent();
}
if(parent1 != null && parent2 != null && parent1.getString().equals(parent2.getString())) {
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.getName(),
creationCoveringTheEntireStatement2.getName(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION);
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.actualString(),
creationCoveringTheEntireStatement2.actualString(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
Expand All @@ -8269,14 +8269,14 @@ else if(operationInvocation1.inlinedStatementBecomesAdditionalArgument(invocatio
return replacementInfo.getReplacements();
}
else if(creationCoveringTheEntireStatement1.identicalWithDifferentNumberOfArguments(creationCoveringTheEntireStatement2, replacementInfo.getReplacements(), parameterToArgumentMap)) {
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.getName(),
creationCoveringTheEntireStatement2.getName(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.actualString(),
creationCoveringTheEntireStatement2.actualString(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
else if(creationCoveringTheEntireStatement1.inlinedStatementBecomesAdditionalArgument(creationCoveringTheEntireStatement2, replacementInfo.getReplacements(), replacementInfo.statements1)) {
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.getName(),
creationCoveringTheEntireStatement2.getName(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
Replacement replacement = new ObjectCreationReplacement(creationCoveringTheEntireStatement1.actualString(),
creationCoveringTheEntireStatement2.actualString(), creationCoveringTheEntireStatement1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
Expand Down Expand Up @@ -8334,14 +8334,14 @@ else if(creationCoveringTheEntireStatement1.inlinedStatementBecomesAdditionalArg
return replacementInfo.getReplacements();
}
else if(objectCreation1.identicalWithDifferentNumberOfArguments(creationCoveringTheEntireStatement2, replacementInfo.getReplacements(), parameterToArgumentMap)) {
Replacement replacement = new ObjectCreationReplacement(objectCreation1.getName(),
creationCoveringTheEntireStatement2.getName(), (ObjectCreation)objectCreation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
Replacement replacement = new ObjectCreationReplacement(objectCreation1.actualString(),
creationCoveringTheEntireStatement2.actualString(), (ObjectCreation)objectCreation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
else if(objectCreation1.inlinedStatementBecomesAdditionalArgument(creationCoveringTheEntireStatement2, replacementInfo.getReplacements(), replacementInfo.statements1)) {
Replacement replacement = new ObjectCreationReplacement(objectCreation1.getName(),
creationCoveringTheEntireStatement2.getName(), (ObjectCreation)objectCreation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
Replacement replacement = new ObjectCreationReplacement(objectCreation1.actualString(),
creationCoveringTheEntireStatement2.actualString(), (ObjectCreation)objectCreation1, creationCoveringTheEntireStatement2, ReplacementType.CLASS_INSTANCE_CREATION_ARGUMENT);
replacementInfo.addReplacement(replacement);
return replacementInfo.getReplacements();
}
Expand Down

0 comments on commit 1050c28

Please sign in to comment.