Another fix for issue
@@ -271,7 +271,7 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
List<UMLParameter> addedParameters = operationSignatureDiff.getAddedParameters();
if(addedParameters.size() == 1) {
UMLParameter addedParameter = addedParameters.get(0);
- if(UMLModelDiff.looksLikeSameType(addedParameter.getType().getClassType(), operation1.getClassName())) {
+ if(!operation1.isDeclaredInAnonymousClass() && UMLModelDiff.looksLikeSameType(addedParameter.getType().getClassType(), operation1.getClassName())) {
parameterToArgumentMap1.put("this.", "");
//replace "parameterName." with ""
parameterToArgumentMap2.put(addedParameter.getName() + ".", "");
@@ -280,7 +280,7 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
List<UMLParameter> removedParameters = operationSignatureDiff.getRemovedParameters();
if(removedParameters.size() == 1) {
UMLParameter removedParameter = removedParameters.get(0);
- if(UMLModelDiff.looksLikeSameType(removedParameter.getType().getClassType(), operation2.getClassName())) {
+ if(!operation2.isDeclaredInAnonymousClass() && UMLModelDiff.looksLikeSameType(removedParameter.getType().getClassType(), operation2.getClassName())) {
parameterToArgumentMap1.put(removedParameter.getName() + ".", "");
parameterToArgumentMap2.put("this.", "");
}
@@ -289,7 +289,8 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
for(UMLParameterDiff parameterDiff : parameterDiffList) {
UMLParameter addedParameter = parameterDiff.getAddedParameter();
UMLParameter removedParameter = parameterDiff.getRemovedParameter();
- if(UMLModelDiff.looksLikeSameType(addedParameter.getType().getClassType(), operation1.getClassName()) &&
+ if(!operation1.isDeclaredInAnonymousClass() && !operation2.isDeclaredInAnonymousClass() &&
+ UMLModelDiff.looksLikeSameType(addedParameter.getType().getClassType(), operation1.getClassName()) &&
UMLModelDiff.looksLikeSameType(removedParameter.getType().getClassType(), operation2.getClassName())) {
parameterToArgumentMap1.put("this.", "");
parameterToArgumentMap2.put(addedParameter.getName() + ".", "");
@@ -299,7 +300,7 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
}
if(classDiff != null) {
for(UMLAttribute attribute : classDiff.getOriginalClass().getAttributes()) {
- if(UMLModelDiff.looksLikeSameType(attribute.getType().getClassType(), operation2.getClassName())) {
+ if(!operation2.isDeclaredInAnonymousClass() && UMLModelDiff.looksLikeSameType(attribute.getType().getClassType(), operation2.getClassName())) {
parameterToArgumentMap1.put(attribute.getName() + ".", "");
parameterToArgumentMap2.put("this.", "");
}
