Uses of Interface
com.google.errorprone.fixes.Fix
Package
Description
Checks added to the java compiler which detect common bug patterns.
Support code for providing automated corrections for defects we find.
A predicate DSL for matching javac AST nodes.
-
Uses of Fix in com.google.errorprone
Modifier and TypeMethodDescription -
Uses of Fix in com.google.errorprone.apply
-
Uses of Fix in com.google.errorprone.bugpatterns
Modifier and TypeMethodDescriptionstatic Fix
MissingFail.addFailCall
(com.sun.source.tree.TryTree tree, com.sun.source.tree.StatementTree lastTryStatement, VisitorState state) Modifier and TypeMethodDescriptionStringSplitter.buildFix
(com.sun.source.tree.MethodInvocationTree tree, VisitorState state) static com.google.common.collect.ImmutableList
<Fix> ReplacementVariableFinder.fixesByReplacingExpressionWithLocallyDeclaredField
(com.sun.source.tree.ExpressionTree input, Predicate<com.sun.tools.javac.tree.JCTree.JCVariableDecl> validFieldPredicate, VisitorState state) Suggest replacinginput
with a qualified reference to a locally declared field with a similar or the same name as theinput
expression.static com.google.common.collect.ImmutableList
<Fix> ReplacementVariableFinder.fixesByReplacingExpressionWithMethodParameter
(com.sun.source.tree.ExpressionTree input, Predicate<com.sun.tools.javac.tree.JCTree.JCVariableDecl> validParameterPredicate, VisitorState state) Suggest replacinginput
with a reference to a method parameter in the nearest enclosing method declaration with a similar or the same name as theinput
expression.AbstractToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) Constructs a fix for an implicit toString call, e.g.AnnotationMirrorToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) AnnotationValueToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) ArrayToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) LiteProtoToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) ObjectToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) StreamToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) SymbolToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) TreeToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) TypeToString.implicitToStringFix
(com.sun.source.tree.ExpressionTree tree, VisitorState state) ReturnsNullCollection.provideFix
(com.sun.source.tree.ReturnTree tree) AbstractToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree expression, VisitorState state) Constructs a fix for an explicit toString call, e.g.AnnotationMirrorToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) AnnotationValueToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) ArrayToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) LiteProtoToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) ObjectToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) StreamToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) SymbolToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) TreeToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) TypeToString.toStringFix
(com.sun.source.tree.Tree parent, com.sun.source.tree.ExpressionTree tree, VisitorState state) AssertThrowsUtils.tryFailToAssertThrows
(com.sun.source.tree.TryTree tryTree, List<? extends com.sun.source.tree.StatementTree> throwingStatements, Optional<com.sun.source.tree.Tree> failureMessage, VisitorState state) Transforms a try-catch block in the try-fail pattern into a call to JUnit'sassertThrows
, inserting the behavior of thetry
block into a lambda parameter, and assigning the expected exception to a variable, if it is used within thecatch
block.Modifier and TypeMethodDescriptionBugChecker.describeMatch
(com.sun.source.tree.Tree node, Fix fix) Helper to create a Description for the common case where there is a fix.BugChecker.describeMatch
(com.sun.tools.javac.tree.JCTree node, Fix fix) Helper to create a Description for the common case where there is a fix.BugChecker.describeMatch
(com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition position, Fix fix) Helper to create a Description for the common case where there is a fix. -
Uses of Fix in com.google.errorprone.bugpatterns.collectionincompatibletype
-
Uses of Fix in com.google.errorprone.fixes
Modifier and TypeMethodDescriptionstatic Fix
SuggestedFixes.deleteExceptions
(com.sun.source.tree.MethodTree tree, VisitorState state, List<com.sun.source.tree.ExpressionTree> toDelete) Deletes the given exceptions from a method's throws clause.Modifier and TypeMethodDescription@Nullable AppliedFix
Applies the suggestedFix to the source.static boolean
SuggestedFixes.compilesWithFix
(Fix fix, VisitorState state) Returns true if the current compilation would succeed with the given fix applied.static boolean
SuggestedFixes.compilesWithFix
(Fix fix, VisitorState state, com.google.common.collect.ImmutableList<String> extraOptions, boolean onlyInSameCompilationUnit) Returns true if the current compilation would succeed with the given fix applied, using the given additional compiler options, optionally limiting the checking of compilation failures to the compilation unit in which the fix is applied.static SuggestedFixes.FixCompiler
SuggestedFixes.FixCompiler.create
(Fix fix, VisitorState state) -
Uses of Fix in com.google.errorprone.matchers
Modifier and TypeFieldDescriptionfinal com.google.common.collect.ImmutableList
<Fix> Description.fixes
A list of fixes to suggest in an error message or use in automated refactoring.Modifier and TypeMethodDescriptionAdds a suggested fix for thisDescription
.Modifier and TypeMethodDescriptionDescription.Builder.addAllFixes
(List<? extends Fix> fixes) Add each fix in order.Deprecated. -
Uses of Fix in com.google.errorprone.refaster
Modifier and TypeMethodDescriptionprotected static Fix
Template.addImports
(Inliner inliner, SuggestedFix.Builder fix) BlockTemplate.replace
(com.google.errorprone.refaster.BlockTemplateMatch match) ExpressionTemplate.replace
(com.google.errorprone.refaster.ExpressionTemplateMatch match) Generates aSuggestedFix
replacing the specified match (usually of another template) with this template.abstract Fix
SuggestedFix.emptyFix()
.