mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-02 12:39:14 +00:00
Use standard String comparison in PropertyDescriptorComparator
Closes gh-31866
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user