From 0a9abe629c89ce5e033f79cc7ddd972d782acacd Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 5 Feb 2019 16:47:46 +0100 Subject: [PATCH] name variable by role and not by type --- scm-core/src/main/java/sonia/scm/util/Comparables.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scm-core/src/main/java/sonia/scm/util/Comparables.java b/scm-core/src/main/java/sonia/scm/util/Comparables.java index b760021c07..1fb0c5e358 100644 --- a/scm-core/src/main/java/sonia/scm/util/Comparables.java +++ b/scm-core/src/main/java/sonia/scm/util/Comparables.java @@ -53,11 +53,11 @@ public final class Comparables { private static PropertyDescriptor findPropertyDescriptor(String sortBy, BeanInfo info) { PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors(); - Optional optional = Arrays.stream(propertyDescriptors) + Optional 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 BeanInfo createBeanInfo(Class type) {