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!