Class ArrayToString
java.lang.Object
com.google.errorprone.bugpatterns.BugChecker
com.google.errorprone.bugpatterns.AbstractToString
com.google.errorprone.bugpatterns.ArrayToString
- All Implemented Interfaces:
BugChecker.BinaryTreeMatcher
,BugChecker.CompoundAssignmentTreeMatcher
,BugChecker.MethodInvocationTreeMatcher
,Suppressible
,Serializable
- Author:
- adgar@google.com (Mike Edgar), cushon@google.com (Liam Miller-Cushon)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.errorprone.bugpatterns.BugChecker
BugChecker.AnnotatedTypeTreeMatcher, BugChecker.AnnotationTreeMatcher, BugChecker.ArrayAccessTreeMatcher, BugChecker.ArrayTypeTreeMatcher, BugChecker.AssertTreeMatcher, BugChecker.AssignmentTreeMatcher, BugChecker.BinaryTreeMatcher, BugChecker.BlockTreeMatcher, BugChecker.BreakTreeMatcher, BugChecker.CaseTreeMatcher, BugChecker.CatchTreeMatcher, BugChecker.ClassTreeMatcher, BugChecker.CompilationUnitTreeMatcher, BugChecker.CompoundAssignmentTreeMatcher, BugChecker.ConditionalExpressionTreeMatcher, BugChecker.ContinueTreeMatcher, BugChecker.DoWhileLoopTreeMatcher, BugChecker.EmptyStatementTreeMatcher, BugChecker.EnhancedForLoopTreeMatcher, BugChecker.ExpressionStatementTreeMatcher, BugChecker.ForLoopTreeMatcher, BugChecker.IdentifierTreeMatcher, BugChecker.IfTreeMatcher, BugChecker.ImportTreeMatcher, BugChecker.InstanceOfTreeMatcher, BugChecker.IntersectionTypeTreeMatcher, BugChecker.LabeledStatementTreeMatcher, BugChecker.LambdaExpressionTreeMatcher, BugChecker.LiteralTreeMatcher, BugChecker.MemberReferenceTreeMatcher, BugChecker.MemberSelectTreeMatcher, BugChecker.MethodInvocationTreeMatcher, BugChecker.MethodTreeMatcher, BugChecker.ModifiersTreeMatcher, BugChecker.NewArrayTreeMatcher, BugChecker.NewClassTreeMatcher, BugChecker.ParameterizedTypeTreeMatcher, BugChecker.ParenthesizedTreeMatcher, BugChecker.PrimitiveTypeTreeMatcher, BugChecker.ReturnTreeMatcher, BugChecker.SuppressibleTreePathScanner<R,
P>, BugChecker.SwitchTreeMatcher, BugChecker.SynchronizedTreeMatcher, BugChecker.ThrowTreeMatcher, BugChecker.TryTreeMatcher, BugChecker.TypeCastTreeMatcher, BugChecker.TypeParameterTreeMatcher, BugChecker.UnaryTreeMatcher, BugChecker.UnionTypeTreeMatcher, BugChecker.VariableTreeMatcher, BugChecker.WhileLoopTreeMatcher, BugChecker.WildcardTreeMatcher -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
allowableToStringKind
(com.google.errorprone.bugpatterns.AbstractToString.ToStringKind toStringKind) Whether this kind of toString call is allowable for this check.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Constructs a fix for an implicit toString call, e.g.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) Constructs a fix for an explicit toString call, e.g.protected TypePredicate
The type to match on.Methods inherited from class com.google.errorprone.bugpatterns.AbstractToString
descriptionMessageForDefaultMatch, matchBinary, matchCompoundAssignment, matchMethodInvocation
Methods inherited from class com.google.errorprone.bugpatterns.BugChecker
allNames, buildDescription, buildDescription, buildDescription, canonicalName, customSuppressionAnnotations, defaultSeverity, describeMatch, describeMatch, describeMatch, describeMatch, describeMatch, describeMatch, disableable, equals, hashCode, isSuppressed, isSuppressed, isSuppressed, isSuppressed, linkUrl, message, supportsSuppressWarnings, suppressedByAnyOf, suppressedRegions
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.errorprone.matchers.Suppressible
allNames, canonicalName, customSuppressionAnnotations, supportsSuppressWarnings, suppressedByAnyOf
-
Method Details
-
typePredicate
Description copied from class:AbstractToString
The type to match on.- Specified by:
typePredicate
in classAbstractToString
-
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 toprintln
orStringBuilder.append
.- Specified by:
implicitToStringFix
in classAbstractToString
- 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 classAbstractToString
-
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. fromObject.toString()
orString.valueOf()
.- Specified by:
toStringFix
in classAbstractToString
- Parameters:
parent
- the expression's parent (e.g.String.valueOf(expression)
)
-