Use standard String comparison in PropertyDescriptorComparator

Closes gh-31866
This commit is contained in:
Juergen Hoeller 2023-12-20 08:45:53 +01:00
parent 212346a86d
commit 4c0d0ba5b3
1 changed files with 1 additions and 14 deletions

View File

@ -524,20 +524,7 @@ class ExtendedBeanInfo implements BeanInfo {
@Override
public int compare(PropertyDescriptor desc1, PropertyDescriptor desc2) {
String left = desc1.getName();
String right = desc2.getName();
byte[] leftBytes = left.getBytes();
byte[] rightBytes = right.getBytes();
for (int i = 0; i < left.length(); i++) {
if (right.length() == i) {
return 1;
}
int result = leftBytes[i] - rightBytes[i];
if (result != 0) {
return result;
}
}
return left.length() - right.length();
return desc1.getName().compareTo(desc2.getName());
}
}