Use standard String comparison in PropertyDescriptorComparator
Closes gh-31866
This commit is contained in:
parent
212346a86d
commit
4c0d0ba5b3
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue