Skip to content

Commit

Permalink
Use Comparator.comparing and method references instead of lambda expr…
Browse files Browse the repository at this point in the history
…essions
  • Loading branch information
astefanutti committed Apr 20, 2016
1 parent 71f80b2 commit 436256f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impl/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static String createBeanAttributesId(BeanAttributes<?> attributes) {
*/
private static String createTypeCollectionId(Collection<? extends Type> types) {
return types.stream()
.sorted((t1, t2) -> createTypeId(t1).compareTo(createTypeId(t2)))
.sorted(Comparator.comparing(CdiSpiHelper::createTypeId))
.map(CdiSpiHelper::createTypeId)
.collect(Collectors.joining(",", "[", "]"));
}
Expand Down Expand Up @@ -138,7 +138,7 @@ private static String createAnnotationId(Annotation annotation) {
(PrivilegedAction<Method[]>) () -> annotation.annotationType().getDeclaredMethods());

return Stream.of(methods)
.sorted((m1, m2) -> m1.getName().compareTo(m2.getName()))
.sorted(Comparator.comparing(Method::getName))
.collect(() -> new StringJoiner(",", "@(", ")"),
(joiner, method) -> {
try {
Expand Down

0 comments on commit 436256f

Please sign in to comment.