MCPcopy Create free account
hub / github.com/antlr/codebuff / comparator

Method comparator

corpus/java/training/guava/collect/Maps.java:3951–3963  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3949 private transient Comparator<? super K> comparator;
3950
3951 @SuppressWarnings("unchecked")
3952 @Override
3953 public Comparator<? super K> comparator() {
3954 Comparator<? super K> result = comparator;
3955 if (result == null) {
3956 Comparator<? super K> forwardCmp = forward().comparator();
3957 if (forwardCmp == null) {
3958 forwardCmp = (Comparator) Ordering.natural();
3959 }
3960 result = comparator = reverse(forwardCmp);
3961 }
3962 return result;
3963 }
3964
3965 // If we inline this, we get a javac error.
3966 private static <T> Ordering<T> reverse(Comparator<T> forward) {

Callers

nothing calls this directly

Calls 4

forwardMethod · 0.95
naturalMethod · 0.95
reverseMethod · 0.95
comparatorMethod · 0.65

Tested by

no test coverage detected