From 65203a3704ecc42302860ecbafff25d7134154e9 Mon Sep 17 00:00:00 2001 From: tsantalis Date: Sun, 8 Dec 2024 04:51:03 -0500 Subject: [PATCH] Use identicalBody information to promote ClassRenameDiff in case of ties --- .../gr/uom/java/xmi/diff/UMLModelDiff.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java b/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java index c587d510d..833c6b21a 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java @@ -1059,6 +1059,29 @@ private TreeSet findRenameMatchesForRemovedClass(UMLClass re } } } + if(diffSet.size() > 1) { + TreeSet identicalBodyDiffSet = new TreeSet(new ClassRenameComparator()); + for(UMLClassRenameDiff diff : diffSet) { + List operations1 = diff.getOriginalClass().getOperations(); + List operations2 = diff.getNextClass().getOperations(); + int identicalBodies = 0; + if(operations1.size() == operations2.size()) { + for(int i=0; i findRenameMatchesForAddedClass(UMLClass adde } } } + if(diffSet.size() > 1) { + TreeSet identicalBodyDiffSet = new TreeSet(new ClassRenameComparator()); + for(UMLClassRenameDiff diff : diffSet) { + List operations1 = diff.getOriginalClass().getOperations(); + List operations2 = diff.getNextClass().getOperations(); + int identicalBodies = 0; + if(operations1.size() == operations2.size()) { + for(int i=0; i