private int compareParameter ( Class < ? > a , Class < ? > b ) { final int a_preferred = - 1 ; if ( a . equals ( b ) ) { return 0 ; } else if ( b . isAssignableFrom ( a ) ) { // a is more specific return a_preferred ; } else if ( a . isAssignableFrom ( b ) ) { // b is more specific return - a_preferred ; } else { return 0 ; // not compatible } }
Compares two parameter types .