Skip to content

Commit

Permalink
Use Comparators.lexicographical instead of Ordering.from in DeclaredM…
Browse files Browse the repository at this point in the history
…embers
  • Loading branch information
panic08 committed Oct 24, 2024
1 parent d83f677 commit 69b8f5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/com/google/inject/internal/DeclaredMembers.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.google.inject.internal;

import com.google.common.collect.Ordering;
import com.google.common.collect.Comparators;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
Expand Down Expand Up @@ -50,10 +50,10 @@ public static Method[] getDeclaredMethods(Class<?> type) {
Comparator.comparing(Method::getName)
.thenComparing(Method::getReturnType, Comparator.comparing(Class::getName))
.thenComparing(
method -> Arrays.asList(method.getParameterTypes()),
// TODO: use Comparators.lexicographical when it's not @Beta.
Ordering.<Class<?>>from(Comparator.comparing(Class::getName))
.lexicographical()))
method -> Arrays.asList(method.getParameterTypes()),
Comparators.lexicographical(Comparator.comparing(Class::getName))
)
)
.toArray(Method[]::new);
}
}

0 comments on commit 69b8f5a

Please sign in to comment.