Class ArrayToString

All Implemented Interfaces:
BugChecker.BinaryTreeMatcher, BugChecker.CompoundAssignmentTreeMatcher, BugChecker.MethodInvocationTreeMatcher, Suppressible, Serializable

public class ArrayToString
extends AbstractToString
Author:
adgar@google.com (Mike Edgar), cushon@google.com (Liam Miller-Cushon)
See Also:
Serialized Form
  • Constructor Details

    • ArrayToString

      public ArrayToString()
  • Method Details

    • typePredicate

      protected TypePredicate typePredicate()
      Description copied from class: AbstractToString
      The type to match on.
      Specified by:
      typePredicate in class AbstractToString
    • implicitToStringFix

      protected Optional<Fix> implicitToStringFix​(com.sun.source.tree.ExpressionTree tree, VisitorState state)
      Description copied from class: AbstractToString
      Constructs a fix for an implicit toString call, e.g. from string concatenation or from passing an argument to println or StringBuilder.append.
      Specified by:
      implicitToStringFix in class AbstractToString
      Parameters:
      tree - the tree node for the expression being converted to a String
    • allowableToStringKind

      protected boolean allowableToStringKind​(com.google.errorprone.bugpatterns.AbstractToString.ToStringKind toStringKind)
      Description copied from class: AbstractToString
      Whether this kind of toString call is allowable for this check.
      Overrides:
      allowableToStringKind in class AbstractToString
    • toStringFix

      protected Optional<Fix> toStringFix​(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state)
      Description copied from class: AbstractToString
      Constructs a fix for an explicit toString call, e.g. from Object.toString() or String.valueOf().
      Specified by:
      toStringFix in class AbstractToString
      Parameters:
      parent - the expression's parent (e.g. String.valueOf(expression))