MCPcopy Create free account
hub / github.com/apache/tomcat / compareTo

Method compareTo

java/jakarta/el/Util.java:661–686  ·  view source on GitHub ↗
(MatchResult o)

Source from the content-addressed store, hash-verified

659 }
660
661 @Override
662 public int compareTo(MatchResult o) {
663 // Non-varArgs always beats varArgs
664 int cmp = Boolean.compare(o.isVarArgs(), this.isVarArgs());
665 if (cmp == 0) {
666 cmp = Integer.compare(this.getExactCount(), o.getExactCount());
667 if (cmp == 0) {
668 cmp = Integer.compare(this.getAssignableCount(), o.getAssignableCount());
669 if (cmp == 0) {
670 cmp = Integer.compare(this.getCoercibleCount(), o.getCoercibleCount());
671 if (cmp == 0) {
672 // Fewer var args matches are better
673 cmp = Integer.compare(o.getVarArgsCount(), this.getVarArgsCount());
674 if (cmp == 0) {
675 // The nature of bridge methods is such that it actually
676 // doesn't matter which one we pick as long as we pick
677 // one. That said, pick the 'right' one (the non-bridge
678 // one) anyway.
679 cmp = Boolean.compare(o.isBridge(), this.isBridge());
680 }
681 }
682 }
683 }
684 }
685 return cmp;
686 }
687
688 @Override
689 public boolean equals(Object o) {

Callers

nothing calls this directly

Calls 9

isVarArgsMethod · 0.95
getExactCountMethod · 0.95
getAssignableCountMethod · 0.95
getCoercibleCountMethod · 0.95
getVarArgsCountMethod · 0.95
isBridgeMethod · 0.95
compareMethod · 0.45
isVarArgsMethod · 0.45
isBridgeMethod · 0.45

Tested by

no test coverage detected