{
}
public int compare(final MBeanOperationInfo info1, final MBeanOperationInfo info2)
{
final MBeanOperationInfoStringifier sf = OPERATION_INFO_STRINGIFIER;
// we just want to sort based on name and signature; there can't be two operations with the
// same name and same signature, so as long as we include the name and signature the
// sorting will always be consistent.
int c = info1.getName().compareTo(info2.getName());
if (c == 0)
{
// names the same, subsort on signature, first by number of params
c = info1.getSignature().length - info2.getSignature().length;
if (c == 0)
{
// names the same, subsort on signature, first by number of params
c = sf.getSignature(info1).compareTo(sf.getSignature(info2));
}
}
return (c);