79825487

Date: 2025-11-20 12:04:02
Score: 3.5
Natty:
Report link

I've looked at ErrorProne ArgumentSelectionDefectChecker, but it does not give me any warning for this.

void startSomethingElse(long accountId, long balance) {
    System.out.println("Account " + accountId + " balance " + balance);
}

void startOfSomething() {
    long accountId = 1;
    long balance = 100;
    startSomethingElse(balance, accountId);
}

However, it works for this. I guess it needs custom annotations for its heuristic. These are my CheckerFramework annotations :)

void startSomethingElse(@AccountIdParam long accountId, @BalanceParam long balance) {
    System.out.println("Account " + accountId + " balance " + balance);
}

void startOfSomething() {
    long accountId = 1;
    long balance = 100;
    startSomethingElse(balance, accountId);
}

What am I doing wrong? Thanks!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): What am I doing wrong?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: fritz