mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-11 14:42:34 +02:00
name variable by role and not by type
This commit is contained in:
@@ -53,11 +53,11 @@ public final class Comparables {
|
||||
private static PropertyDescriptor findPropertyDescriptor(String sortBy, BeanInfo info) {
|
||||
PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
|
||||
|
||||
Optional<PropertyDescriptor> optional = Arrays.stream(propertyDescriptors)
|
||||
Optional<PropertyDescriptor> sortByPropertyDescriptor = Arrays.stream(propertyDescriptors)
|
||||
.filter(p -> p.getName().equals(sortBy))
|
||||
.findFirst();
|
||||
|
||||
return optional.orElseThrow(() -> new IllegalArgumentException("could not find property " + sortBy));
|
||||
return sortByPropertyDescriptor.orElseThrow(() -> new IllegalArgumentException("could not find property " + sortBy));
|
||||
}
|
||||
|
||||
private static <T> BeanInfo createBeanInfo(Class<T> type) {
|
||||
|
||||
Reference in New Issue
Block a user