jmultimethod

multimethods for Java using annotations
git clone https://logand.com/git/jmultimethod.git/
Log | Files | Refs | LICENSE

commit ff34246932785c0fbd42b6c30ddb95d7b206130d
parent 8bba03806d8ac1d30151bdb0d2cf31677c3e7122
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sat, 26 Dec 2015 23:41:10 +0100

add comparator case for the same methods

Diffstat:
Msrc/jmultimethod/Multimethod.java | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/jmultimethod/Multimethod.java b/src/jmultimethod/Multimethod.java @@ -46,6 +46,9 @@ public class Multimethod { protected class MethodComparator implements Comparator<Method> { @Override public int compare(Method l, Method r) { + if(l.equals(r)) { + return 0; + } // most specific methods first Class[] lc = l.getParameterTypes(); Class[] rc = r.getParameterTypes();