throw new ClassCastException(JDIMessages.FieldImpl_Can__t_compare_field_to_given_object_1);
// See if declaring types are the same, if not return comparison between
// declaring types.
Field type2 = object;
if (!declaringType().equals(type2.declaringType()))
return declaringType().compareTo(type2.declaringType());
// Return comparison of position within declaring type.
int index1 = declaringType().fields().indexOf(this);
int index2 = type2.declaringType().fields().indexOf(type2);