Class ArgumentSelectionDefectChecker

java.lang.Object
com.google.errorprone.bugpatterns.BugChecker
com.google.errorprone.bugpatterns.argumentselectiondefects.ArgumentSelectionDefectChecker
All Implemented Interfaces:
BugChecker.MethodInvocationTreeMatcher, BugChecker.NewClassTreeMatcher, Suppressible, Serializable

public class ArgumentSelectionDefectChecker extends BugChecker implements BugChecker.MethodInvocationTreeMatcher, BugChecker.NewClassTreeMatcher
Checks the lexical distance between method parameter names and the argument names at call sites. If another permutation of the arguments produces a lower distance then it is possible that the programmer has accidentally reordered them.

Rice, Andrew, et al. "Detecting argument selection defects". Proceedings of the ACM on Programming Languages OOPSLA (2017).

Terminology:

  • Formal parameter - as given in the definition of the method
  • Actual parameter - as used in the invocation of the method
  • Parameter - either a formal or actual parameter
Author:
andrewrice@google.com (Andrew Rice)
See Also: