From 6f954da53ee6cbf020776dffe182bc1cb6b7e757 Mon Sep 17 00:00:00 2001 From: tsantalis Date: Fri, 3 Jan 2025 17:06:44 -0500 Subject: [PATCH] Further improvement to avoid Move Class org.apache.lucene.codecs.lucene84.Lucene84PostingsFormat.IntBlockTermState moved to org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat.IntBlockTermState in commit https://github.com/apache/lucene-solr/commit/f43fe7642e9f1eb48b7438e2b132d9efc641edb6 --- src/main/java/gr/uom/java/xmi/diff/ClassMoveComparator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/gr/uom/java/xmi/diff/ClassMoveComparator.java b/src/main/java/gr/uom/java/xmi/diff/ClassMoveComparator.java index 11cf70049..007efd24a 100644 --- a/src/main/java/gr/uom/java/xmi/diff/ClassMoveComparator.java +++ b/src/main/java/gr/uom/java/xmi/diff/ClassMoveComparator.java @@ -21,7 +21,12 @@ public int compare(UMLClassMoveDiff o1, UMLClassMoveDiff o2) { int lineNumberDifference2 = Math.abs(o2.getOriginalClass().getLocationInfo().getCompilationUnitLength() - o2.getNextClass().getLocationInfo().getCompilationUnitLength()); boolean isEmpty1 = o1.getOriginalClass().isEmpty() && o1.getNextClass().isEmpty(); boolean isEmpty2 = o2.getOriginalClass().isEmpty() && o2.getNextClass().isEmpty(); + boolean topLevelClass1 = o1.getOriginalClass().isTopLevel() && o1.getNextClass().isTopLevel(); + boolean topLevelClass2 = o2.getOriginalClass().isTopLevel() && o2.getNextClass().isTopLevel(); if(set1.size() != set2.size() && !isEmpty1 && !isEmpty2) { + if(sameNumberOfLines1 == sameNumberOfLines2 && !topLevelClass1 && !topLevelClass2) { + return -Integer.compare(set1.size(), set2.size()); + } if(lineNumberDifference1 == lineNumberDifference2) return -Integer.compare(set1.size(), set2.size()); else {