Uses of Class
com.google.errorprone.fixes.SuggestedFix
Packages that use SuggestedFix
Package
Description
Checks added to the java compiler which detect common bug patterns.
Support code for providing automated corrections for defects we find.
-
Uses of SuggestedFix in com.google.errorprone.bugpatterns
Methods in com.google.errorprone.bugpatterns that return SuggestedFixModifier and TypeMethodDescriptionprotected static @Nullable SuggestedFixSelfEquals.fieldFix(Tree toReplace, VisitorState state) -
Uses of SuggestedFix in com.google.errorprone.bugpatterns.threadsafety
Method parameters in com.google.errorprone.bugpatterns.threadsafety with type arguments of type SuggestedFixModifier and TypeMethodDescriptiondefault DescriptionImmutableAnalysis.ViolationReporter.report(Tree tree, ThreadSafety.Violation info, Optional<SuggestedFix> suggestedFix) -
Uses of SuggestedFix in com.google.errorprone.fixes
Methods in com.google.errorprone.fixes that return SuggestedFixModifier and TypeMethodDescriptionstatic SuggestedFixSuggestedFixes.addMembers(ClassTree classTree, VisitorState state, SuggestedFixes.AdditionPosition where, String firstMember, String... otherMembers) Returns aFixthat adds members defined byfirstMember(and optionallyotherMembers) to the class referenced byclassTree.static SuggestedFixSuggestedFixes.addMembers(ClassTree classTree, VisitorState state, String firstMember, String... otherMembers) Returns aFixthat adds members defined byfirstMember(and optionallyotherMembers) to the end of the class referenced byclassTree.static SuggestedFixSuggestedFixes.addSuppressWarnings(VisitorState state, String warningToSuppress) Returns a fix that adds a@SuppressWarnings(warningToSuppress)to the closest suppressible element to the node pointed at bystate.getPath().static SuggestedFixSuggestedFixes.addSuppressWarnings(VisitorState state, String warningToSuppress, @Nullable String lineComment) Returns a fix that adds a@SuppressWarnings(warningToSuppress)to the closest suppressible element to the node pointed at bystate.getPath(), optionally suffixing the suppression with a comment suffix (e.g. a reason for the suppression).SuggestedFix.Builder.build()static SuggestedFixstatic SuggestedFixSuggestedFix.emptyFix()Creates an emptySuggestedFix.static SuggestedFixSuggestedFix.merge(SuggestedFix first, SuggestedFix second, SuggestedFix... more) static SuggestedFixSuggestedFix.postfixWith(Tree node, String postfix) static SuggestedFixSuggestedFix.prefixWith(Tree node, String prefix) static SuggestedFixSuggestedFixes.removeElement(Tree tree, List<? extends Tree> trees, VisitorState state) Removestreefromtrees, assuming thattreesrepresents a comma-separated list of expressions containingtree.static SuggestedFixSuggestedFixes.renameClassWithUses(ClassTree tree, String replacement, VisitorState state) Rename a class and all uses of it in the current file.static SuggestedFixSuggestedFixes.renameMethod(MethodTree tree, String replacement, VisitorState state) Be warned, only changes method name at the declaration.static SuggestedFixSuggestedFixes.renameMethodInvocation(MethodInvocationTree tree, String replacement, VisitorState state) Replaces the name of the method being invoked intreewithreplacement.static SuggestedFixSuggestedFixes.renameMethodWithInvocations(MethodTree tree, String replacement, VisitorState state) Renames the givenMethodTreeand its usages in the current compilation unit toreplacement.static SuggestedFixSuggestedFixes.renameTypeParameter(TypeParameterTree typeParameter, Tree owningTree, String typeVarReplacement, VisitorState state) Renames a type parametertypeParameterowned byowningTreetotypeVarReplacement.static SuggestedFixSuggestedFixes.renameVariable(VariableTree tree, String replacement, VisitorState state) Renames the givenVariableTreeand its usages in the current compilation unit toreplacement.static SuggestedFixSuggestedFixes.renameVariableUsages(VariableTree tree, String replacement, VisitorState state) Renames usage of the givenVariableTreein the current compilation unit toreplacement.static SuggestedFixReplace the characters from startPos, inclusive, until endPos, exclusive, with the given string.static SuggestedFixstatic SuggestedFixReplace a tree node with a string, but adjust the start and end positions as well.static SuggestedFixSuggestedFixes.replaceIncludingComments(TreePath path, String replacement, VisitorState state) Replaces the tree atpathalong with any Javadocs/associated single-line comments.static SuggestedFixSuggestedFix.swap(Tree node1, Tree node2, VisitorState state) Methods in com.google.errorprone.fixes that return types with arguments of type SuggestedFixModifier and TypeMethodDescriptionstatic Optional<SuggestedFix> SuggestedFixes.addMembers(ClassTree classTree, VisitorState state, SuggestedFixes.AdditionPosition where, Iterable<String> members) static Optional<SuggestedFix> SuggestedFixes.addModifiers(Tree tree, VisitorState state, Modifier... modifiers) Adds modifiers to the given class, method, or field declaration.static Optional<SuggestedFix> SuggestedFixes.addModifiers(Tree tree, ModifiersTree originalModifiers, VisitorState state, Set<Modifier> modifiers) Adds modifiers to the given declaration and corresponding modifiers tree.com.google.common.collect.ImmutableList<SuggestedFix> BranchedSuggestedFixes.getFixes()static Collector<SuggestedFix, ?, SuggestedFix> SuggestedFix.mergeFixes()static Collector<SuggestedFix, ?, SuggestedFix> SuggestedFix.mergeFixes()static Optional<SuggestedFix> SuggestedFixes.removeModifiers(ModifiersTree originalModifiers, VisitorState state, Set<Modifier> toRemove) Removes modifiers to the given declaration and corresponding modifiers tree.static Optional<SuggestedFix> SuggestedFixes.removeModifiers(Tree tree, VisitorState state, Modifier... modifiers) Removes modifiers from the given class, method, or field declaration.static Optional<SuggestedFix> SuggestedFixes.suggestExemptingAnnotation(String exemptingAnnotation, TreePath where, VisitorState state) Create a fix to add a suppression annotation on the surrounding class.Methods in com.google.errorprone.fixes with parameters of type SuggestedFixModifier and TypeMethodDescriptionBranchedSuggestedFixes.Builder.addOption(SuggestedFix fix) SuggestedFix.Builder.merge(@Nullable SuggestedFix other) Merges all edits fromotherintothis.static SuggestedFixSuggestedFix.merge(SuggestedFix first, SuggestedFix second, SuggestedFix... more) BranchedSuggestedFixes.Builder.startWith(SuggestedFix fix)