throw new ClassCastException(
JDIMessages.MethodImpl_Can__t_compare_method_to_given_object_6);
// See if declaring types are the same, if not return comparison between
// declaring types.
Method type2 = method;
if (!declaringType().equals(type2.declaringType()))
return declaringType().compareTo(type2.declaringType());
// Return comparison of position within declaring type.
int index1 = declaringType().methods().indexOf(this);
int index2 = type2.declaringType().methods().indexOf(type2);
if (index1 < index2) {
return -1;
} else if (index1 > index2) {
return 1;
} else {