Uses of Interface
com.google.errorprone.fixes.Fix
Packages that use 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
Methods in com.google.errorprone that return FixModifier and TypeMethodDescriptionMethod parameters in com.google.errorprone with type arguments of type Fix -
Uses of Fix in com.google.errorprone.apply
Methods in com.google.errorprone.apply with parameters of type Fix -
Uses of Fix in com.google.errorprone.bugpatterns
Methods in com.google.errorprone.bugpatterns that return FixModifier and TypeMethodDescriptionstatic Fix
MissingFail.addFailCall
(TryTree tree, StatementTree lastTryStatement, VisitorState state) Methods in com.google.errorprone.bugpatterns that return types with arguments of type FixModifier and TypeMethodDescriptionStringSplitter.buildFix
(MethodInvocationTree tree, VisitorState state) static com.google.common.collect.ImmutableList
<Fix> ReplacementVariableFinder.fixesByReplacingExpressionWithLocallyDeclaredField
(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
(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
(ExpressionTree tree, VisitorState state) Constructs a fix for an implicit toString call, e.g. from string concatenation or from passing an argument toprintln
orStringBuilder.append
.AnnotationMirrorToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) AnnotationValueToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) ArrayToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) LiteProtoToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) ObjectToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) StreamToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) SymbolToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) TreeToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) TypeToString.implicitToStringFix
(ExpressionTree tree, VisitorState state) ReturnsNullCollection.provideFix
(ReturnTree tree) AbstractToString.toStringFix
(Tree parent, ExpressionTree expression, VisitorState state) Constructs a fix for an explicit toString call, e.g. fromObject.toString()
orString.valueOf()
.AnnotationMirrorToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) AnnotationValueToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) ArrayToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) LiteProtoToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) ObjectToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) StreamToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) SymbolToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) TreeToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) TypeToString.toStringFix
(Tree parent, ExpressionTree tree, VisitorState state) AssertThrowsUtils.tryFailToAssertThrows
(TryTree tryTree, List<? extends StatementTree> throwingStatements, Optional<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.Methods in com.google.errorprone.bugpatterns with parameters of type FixModifier and TypeMethodDescriptionBugChecker.describeMatch
(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
Methods in com.google.errorprone.bugpatterns.collectionincompatibletype that return types with arguments of type Fix -
Uses of Fix in com.google.errorprone.fixes
Classes in com.google.errorprone.fixes that implement FixMethods in com.google.errorprone.fixes that return FixModifier and TypeMethodDescriptionstatic Fix
SuggestedFixes.deleteExceptions
(MethodTree tree, VisitorState state, List<ExpressionTree> toDelete) Deletes the given exceptions from a method's throws clause.Methods in com.google.errorprone.fixes with parameters of type FixModifier and TypeMethodDescription@Nullable AppliedFix
Applies the suggestedFix to the source.AppliedFix.Applier.applyReplacements
(Fix fix) 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
Fields in com.google.errorprone.matchers with type parameters of type FixModifier 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.Methods in com.google.errorprone.matchers with parameters of type FixModifier and TypeMethodDescriptionAdds a suggested fix for thisDescription
.Method parameters in com.google.errorprone.matchers with type arguments of type FixModifier and TypeMethodDescriptionDescription.Builder.addAllFixes
(List<? extends Fix> fixes) Add each fix in order.Deprecated. -
Uses of Fix in com.google.errorprone.refaster
Methods in com.google.errorprone.refaster that return FixModifier 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()
.