@Override public int compareTo(XMethodParameter mp2) { int result = method.compareTo(mp2.method); if (result != 0) { return result; } return parameter - mp2.parameter; }
private boolean checkNonSuper(XMethod m, Set<XMethod> others) { if (m.isStatic()) { return false; } if (m.getName().startsWith(Const.CONSTRUCTOR_NAME) || m.getName().startsWith(Const.STATIC_INITIALIZER_NAME)) { return false; } for (XMethod m2 : others) { if (confusingMethodNamesWrongCapitalization(m, m2)) { XMethod mm1; XMethod mm2; if (m.compareTo(m2) < 0) { mm1 = m; mm2 = m2; } else { mm1 = m2; mm2 = m; } bugReporter.reportBug(new BugInstance(this, "NM_CONFUSING", LOW_PRIORITY).addClass(mm1.getClassName()) .addMethod(mm1).addClass(mm2.getClassName()).addMethod(mm2)); return true; } } return false; }
@Override @SuppressWarnings("unchecked") public int compareTo(XMethodParameter mp2) { int result = method.compareTo(mp2.method); if (result != 0) { return result; } return parameter - mp2.parameter; }
private boolean checkNonSuper(XMethod m, Set<XMethod> others) { if (m.isStatic()) { return false; } if (m.getName().startsWith("<init>") || m.getName().startsWith("<clinit>")) { return false; } for (XMethod m2 : others) { if (confusingMethodNamesWrongCapitalization(m, m2)) { XMethod mm1; XMethod mm2; if (m.compareTo(m2) < 0) { mm1 = m; mm2 = m2; } else { mm1 = m2; mm2 = m; } bugReporter.reportBug(new BugInstance(this, "NM_CONFUSING", LOW_PRIORITY).addClass(mm1.getClassName()) .addMethod(mm1).addClass(mm2.getClassName()).addMethod(mm2)); return true; } } return false; }