Class FloggerRequiredModifiers
java.lang.Object
com.google.errorprone.bugpatterns.BugChecker
com.google.errorprone.bugpatterns.flogger.FloggerRequiredModifiers
- All Implemented Interfaces:
BugChecker.IdentifierTreeMatcher
,BugChecker.MemberSelectTreeMatcher
,BugChecker.MethodInvocationTreeMatcher
,BugChecker.VariableTreeMatcher
,Suppressible
,Serializable
public final class FloggerRequiredModifiers extends BugChecker implements BugChecker.MethodInvocationTreeMatcher, BugChecker.IdentifierTreeMatcher, BugChecker.MemberSelectTreeMatcher, BugChecker.VariableTreeMatcher
Ensures that class-level FluentLogger objects are private static final.
- See Also:
- Serialized Form
-
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<A,B>, BugChecker.SwitchTreeMatcher, BugChecker.SynchronizedTreeMatcher, BugChecker.ThrowTreeMatcher, BugChecker.TryTreeMatcher, BugChecker.TypeCastTreeMatcher, BugChecker.TypeParameterTreeMatcher, BugChecker.UnaryTreeMatcher, BugChecker.UnionTypeTreeMatcher, BugChecker.VariableTreeMatcher, BugChecker.WhileLoopTreeMatcher, BugChecker.WildcardTreeMatcher
-
Constructor Summary
Constructors Constructor Description FloggerRequiredModifiers(ErrorProneFlags flags)
Constructs a checker configured byflags
. -
Method Summary
Modifier and Type Method Description Description
matchIdentifier(com.sun.source.tree.IdentifierTree tree, VisitorState state)
Description
matchMemberSelect(com.sun.source.tree.MemberSelectTree tree, VisitorState state)
Description
matchMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, VisitorState state)
Description
matchVariable(com.sun.source.tree.VariableTree tree, VisitorState state)
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
-
Constructor Details
-
FloggerRequiredModifiers
Constructs a checker configured byflags
. The only flag this constructor looks at is"FloggerRequiredModifiers:Goal"
. It expects that flag to have one of the following values:REHOME_FOREIGN_LOGGERS
HIDE_LOGGERS_IN_INTERFACES
HOIST_CONSTANT_EXPRESSIONS
ADD_FINAL
ADD_STATIC
MAKE_PRIVATE
DEFAULT_ALL_GOALS
The default value is
DEFAULT_ALL_GOALS
, which enables all features; other legal values check only a subset of the Flogger best practices, and are designed to generate a more fine grained adjustments.
-
-
Method Details
-
matchVariable
- Specified by:
matchVariable
in interfaceBugChecker.VariableTreeMatcher
-
matchMethodInvocation
public Description matchMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, VisitorState state)- Specified by:
matchMethodInvocation
in interfaceBugChecker.MethodInvocationTreeMatcher
-
matchIdentifier
- Specified by:
matchIdentifier
in interfaceBugChecker.IdentifierTreeMatcher
-
matchMemberSelect
public Description matchMemberSelect(com.sun.source.tree.MemberSelectTree tree, VisitorState state)- Specified by:
matchMemberSelect
in interfaceBugChecker.MemberSelectTreeMatcher
-