Skip to content

Commit

Permalink
All refactorings generate description with qualified types, when present
Browse files Browse the repository at this point in the history
This will help to make comparisons with other tools
  • Loading branch information
tsantalis committed Oct 9, 2024
1 parent b852322 commit e1ca291
Show file tree
Hide file tree
Showing 44 changed files with 128 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(annotation);
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(modifier);
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(parameter.getVariableDeclaration());
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(exceptionType);
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public String toString() {
sb.append(variableAfter);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public String toString() {
sb.append(variableAfter);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public String toString() {
sb.append(string.contains("\n") ? string.substring(0, string.indexOf("\n")) : string);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public String toString() {
sb.append(" to ");
sb.append(changedAccessModifier);
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public String toString() {
sb.append(" to ");
sb.append(qualified ? changedType.toQualifiedString() : changedType.toString());
sb.append(" in method ");
sb.append(qualified ? operationAfter.toQualifiedString() : operationAfter.toString());
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public String toString() {
sb.append(" to ");
sb.append(changedTypes.size() == 1 ? changedTypes.iterator().next() : changedTypes);
sb.append(" in method ");
sb.append(operationAfter.toString());
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public String toString() {
sb.append(qualified ? changedTypeVariable.toQualifiedString() : changedTypeVariable.toString());
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(qualified ? operationAfter.toQualifiedString() : operationAfter.toString());
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ private int indexInArguments(AbstractCall call, LeafExpression expression, int o
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append(extractedOperation);
sb.append(extractedOperation.toQualifiedString());
sb.append(" extracted from ");
sb.append(sourceOperationBeforeExtraction);
sb.append(sourceOperationBeforeExtraction.toQualifiedString());
sb.append(" in class ");
sb.append(getClassName());
if(getRefactoringType().equals(RefactoringType.EXTRACT_AND_MOVE_OPERATION)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public String toString() {
sb.append(variableDeclaration);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ private int indexInArguments(AbstractCall call, LeafExpression expression, int o
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append(inlinedOperation);
sb.append(inlinedOperation.toQualifiedString());
if(getRefactoringType().equals(RefactoringType.INLINE_OPERATION)) {
sb.append(" inlined to ");
sb.append(targetOperationAfterInline);
sb.append(targetOperationAfterInline.toQualifiedString());
sb.append(" in class ");
sb.append(getClassName());
}
Expand All @@ -244,7 +244,7 @@ else if(getRefactoringType().equals(RefactoringType.MOVE_AND_INLINE_OPERATION))
sb.append(" to class ");
sb.append(getTargetOperationAfterInline().getClassName());
sb.append(" & inlined to ");
sb.append(getTargetOperationAfterInline());
sb.append(getTargetOperationAfterInline().toQualifiedString());
}
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public String toString() {
sb.append(variableDeclaration);
String elementType = operationBefore.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public String toString() {
sb.append(newConditional);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public String toString() {
sb.append(catchString);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public String toString() {
sb.append(newConditional);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ public Set<ImmutablePair<String, String>> getInvolvedClassesAfterRefactoring() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append(getMergedMethods());
Set<String> qualifiedNames = new LinkedHashSet<String>();
for(VariableDeclarationContainer container : getMergedMethods()) {
qualifiedNames.add(container.toQualifiedString());
}
sb.append(qualifiedNames);
sb.append(" to ");
sb.append(newMethodAfterMerge);
sb.append(newMethodAfterMerge.toQualifiedString());
sb.append(" in class ").append(classNameAfter);
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public String toString() {
sb.append(newVariable);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public String toString() {
sb.append(" to ");
sb.append(annotationAfter);
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public String toString() {
sb.append(variableAfter);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gr/uom/java/xmi/diff/MoveCodeRefactoring.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append("from ");
sb.append(sourceContainer);
sb.append(sourceContainer.toQualifiedString());
sb.append(" to ");
sb.append(targetContainer);
sb.append(targetContainer.toQualifiedString());
sb.append(" in class ");
sb.append(getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public MoveOperationRefactoring(UMLOperationBodyMapper bodyMapper) {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append(originalOperation);
sb.append(originalOperation.toQualifiedString());
sb.append(" from class ");
sb.append(originalOperation.getClassName());
sb.append(" to ");
sb.append(movedOperation);
sb.append(movedOperation.toQualifiedString());
sb.append(" from class ");
sb.append(movedOperation.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public Set<ImmutablePair<String, String>> getInvolvedClassesAfterRefactoring() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append(removedOperation);
sb.append(removedOperation.toQualifiedString());
sb.append(" to ");
sb.append(parameterizedTestOperation);
sb.append(parameterizedTestOperation.toQualifiedString());
sb.append(" in class ");
sb.append(parameterizedTestOperation.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(annotation);
sb.append(" in method ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(modifier);
sb.append(" in method ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(parameter.getVariableDeclaration());
sb.append(" in method ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public String toString() {
sb.append(getName()).append("\t");
sb.append(exceptionType);
sb.append(" in method ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public String toString() {
sb.append(variableBefore);
String elementType = operationBefore.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public String toString() {
sb.append(variableBefore);
String elementType = operationBefore.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationBefore);
sb.append(operationBefore.toQualifiedString());
sb.append(" from class ");
sb.append(operationBefore.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public RenameOperationRefactoring(UMLOperation originalOperation, UMLOperation r
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getName()).append("\t");
sb.append(originalOperation);
sb.append(originalOperation.toQualifiedString());
sb.append(" renamed to ");
sb.append(renamedOperation);
sb.append(renamedOperation.toQualifiedString());
sb.append(" in class ").append(getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public String toString() {
sb.append(renamedVariable);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public String toString() {
sb.append(" to ");
sb.append(parametersAfter);
sb.append(" in method ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public String toString() {
sb.append(string.contains("\n") ? string.substring(0, string.indexOf("\n")) : string);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public String toString() {
sb.append(newConditional);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public String toString() {
sb.append(extractType(creationAfter));
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public String toString() {
sb.append(pipeline.contains("\n") ? pipeline.substring(0, pipeline.indexOf("\n")) : pipeline);
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public String toString() {
}
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ");
sb.append(operationAfter.getClassName());
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public String toString() {
sb.append("]");
String elementType = operationAfter.getElementType();
sb.append(" in " + elementType + " ");
sb.append(operationAfter);
sb.append(operationAfter.toQualifiedString());
sb.append(" from class ").append(operationAfter.getClassName());
return sb.toString();
}
Expand Down
Loading

0 comments on commit e1ca291

Please sign in to comment.