Skip to content

Commit 67dda3e

Browse files
committed
Remove dead code from ReflectionUtils.defaultFieldSorter()
1 parent 5190dc0 commit 67dda3e

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,16 +1369,7 @@ private static List<Method> toSortedMutableList(Method[] methods) {
13691369
* implementation.
13701370
*/
13711371
private static int defaultFieldSorter(Field field1, Field field2) {
1372-
String name1 = field1.getName();
1373-
String name2 = field2.getName();
1374-
int comparison = Integer.compare(name1.hashCode(), name2.hashCode());
1375-
if (comparison == 0) {
1376-
comparison = name1.compareTo(name2);
1377-
if (comparison == 0) {
1378-
comparison = field1.toString().compareTo(field2.toString());
1379-
}
1380-
}
1381-
return comparison;
1372+
return Integer.compare(field1.getName().hashCode(), field2.getName().hashCode());
13821373
}
13831374

13841375
/**

0 commit comments

Comments
 (0)