Uses of Annotation Interface
com.google.errorprone.annotations.CanIgnoreReturnValue
Packages that use CanIgnoreReturnValue
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 CanIgnoreReturnValue in com.google.errorprone
Methods in com.google.errorprone with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionBugCheckerRefactoringTestHelper.addModules
(String... modules) CompilationTestHelper.addModules
(String... modules) Deprecated.BugCheckerRefactoringTestHelper.ExpectOutput.addOutputLines
(String path, String... output) CompilationTestHelper.addSourceFile
(String path) Deprecated.CompilationTestHelper.addSourceLines
(String path, String... lines) Adds a source file to the test compilation, from the string content of the file.BugCheckerRefactoringTestHelper.allowBreakingChanges()
If set, fixes that produce output that doesn't compile are allowed.CompilationTestHelper.expectErrorMessage
(String key, Predicate<? super String> matcher) Expects an error message matchingmatcher
at the line below a comment matching the key.CompilationTestHelper.expectNoDiagnostics()
Tells the compilation helper to expect that no diagnostics will be generated, even if the source file contains bug markers.CompilationTestHelper.expectResult
(com.sun.tools.javac.main.Main.Result result) Tells the compilation helper to expect a specific result from the compilation, e.g. success or failure.BugCheckerRefactoringTestHelper.ExpectOutput.expectUnchanged()
CompilationTestHelper.matchAllDiagnostics()
By default, the compilation helper will only inspect diagnostics generated by the check being tested.Given a String custom flag in the format"-XepOpt:FlagName=Value"
, places the flag in this builder's dictionary, e.g.Puts a key-value pair directly in this builder's dictionary.Sets custom command-line arguments for the compilation.Sets custom command-line arguments for the compilation.BugCheckerRefactoringTestHelper.setFixChooser
(BugCheckerRefactoringTestHelper.FixChooser chooser) BugCheckerRefactoringTestHelper.setImportOrder
(String importOrder) CompilationTestHelper.withClasspath
(Class<?>... classes) Sets the classpath for the test compilation, overriding the default of using the runtime classpath of the test execution. -
Uses of CanIgnoreReturnValue in com.google.errorprone.apply
Methods in com.google.errorprone.apply with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionboolean
Add an import to the list of imports.boolean
ImportStatements.addAll
(Collection<String> importsToAdd) Add all imports in a collection to this list of imports.ImportOrganizer.OrganizedImports.addGroups
(Map<K, ? extends Collection<ImportOrganizer.Import>> groups, Iterable<K> keys) Add groups of already sorted imports.boolean
Remove an import from the list of imports.boolean
ImportStatements.removeAll
(Collection<String> importsToRemove) Removes all imports in a collection to this list of imports. -
Uses of CanIgnoreReturnValue in com.google.errorprone.bugpatterns
Methods in com.google.errorprone.bugpatterns with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionfinal StronglyType.Builder
StronglyType.Builder.addType
(com.sun.tools.javac.code.Type type) Add a type that can be replaced with a stronger type. -
Uses of CanIgnoreReturnValue in com.google.errorprone.bugpatterns.checkreturnvalue
Methods in com.google.errorprone.bugpatterns.checkreturnvalue with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionResultUsePolicyEvaluator.Builder.addRule
(ResultUseRule<C, S> rule) Adds the givenrule
.ResultUsePolicyEvaluator.Builder.addRules
(ResultUseRule<C, S>... rules) Adds all the givenrules
.ResultUsePolicyEvaluator.Builder.addRules
(Iterable<? extends ResultUseRule<C, S>> rules) Adds all the givenrules
. -
Uses of CanIgnoreReturnValue in com.google.errorprone.bugpatterns.threadsafety
Methods in com.google.errorprone.bugpatterns.threadsafety with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionThreadSafety.Builder.acceptedAnnotations
(Iterable<String> acceptedAnnotations) Annotations that do *not* cause a class to be tested, but which are treated as valid annotations to pass the test; for example, if @ThreadSafe is the marker annotation, @Immutable would be included in this list, as an immutable class is by definition thread-safe.ThreadSafetyKnownTypes.MapBuilder.addAll
(com.google.common.collect.ImmutableMap<String, AnnotationInfo> map) ThreadSafetyKnownTypes.MapBuilder.addClasses
(Set<Class<?>> clazzs) ThreadSafetyKnownTypes.MapBuilder.addStrings
(List<String> classNames) ThreadSafety.Builder.containerOfAnnotation
(Class<? extends Annotation> containerOfAnnotation) An annotation which marks a generic parameter as a container type.ThreadSafety.Builder.containerOfAnnotation
(Iterable<String> containerOfAnnotation) An annotation which marks a generic parameter as a container type.ThreadSafety.Builder.knownTypes
(ThreadSafetyKnownTypes knownTypes) Information about known types and whether they're known to be safe or unsafe.ThreadSafety.Builder.markerAnnotations
(Iterable<String> markerAnnotations) Annotations that will cause a class to be tested with thisThreadSafety
instance; for example, when testing a class for immutability, this should be @Immutable.ThreadSafety.Builder.setPurpose
(ThreadSafety.Purpose purpose) SeeThreadSafety.Purpose
.ThreadSafety.Builder.suppressAnnotation
(Class<? extends Annotation> suppressAnnotation) An annotation which, when found on a class, should suppress the testThreadSafety.Builder.suppressAnnotation
(Iterable<String> suppressAnnotation) An annotation which, when found on a class, should suppress the testThreadSafety.Builder.typeParameterAnnotation
(Class<? extends Annotation> typeParameterAnnotation) An annotation which, when found on a type parameter, indicates that the type parameter may only be instantiated with thread-safe types.ThreadSafety.Builder.typeParameterAnnotation
(Iterable<String> typeParameterAnnotation) An annotation which, when found on a type parameter, indicates that the type parameter may only be instantiated with thread-safe types. -
Uses of CanIgnoreReturnValue in com.google.errorprone.dataflow
Methods in com.google.errorprone.dataflow with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionAccessPathStore.Builder.setInformation
(AccessPath aPath, V value) -
Uses of CanIgnoreReturnValue in com.google.errorprone.fixes
Methods in com.google.errorprone.fixes with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionReplacements.add
(Replacement replacement) Replacements.add
(Replacement replacement, Replacements.CoalescePolicy coalescePolicy) Add an import statement as part of this SuggestedFix.BranchedSuggestedFixes.Builder.addOption
(SuggestedFix fix) SuggestedFix.Builder.addStaticImport
(String importString) Add a static import statement as part of this SuggestedFix.SuggestedFix.Builder.merge
(@Nullable SuggestedFix other) Merges all edits fromother
intothis
.SuggestedFix.Builder.merge
(@Nullable SuggestedFix.Builder other) Merges all edits fromother
intothis
.SuggestedFix.Builder.postfixWith
(Tree node, String postfix) SuggestedFix.Builder.prefixWith
(Tree node, String prefix) SuggestedFix.Builder.removeImport
(String importString) Remove an import statement as part of this SuggestedFix.SuggestedFix.Builder.removeStaticImport
(String importString) Remove a static import statement as part of this SuggestedFix.Replace the characters from startPos, inclusive, until endPos, exclusive, with the given string.SuggestedFix.Builder.replace
(Tree node, String replaceWith, int startPosAdjustment, int endPosAdjustment) Replace a tree node with a string, but adjust the start and end positions as well.SuggestedFix.Builder.setCoalescePolicy
(Replacements.CoalescePolicy coalescePolicy) SuggestedFix.Builder.setShortDescription
(String shortDescription) Sets a custom short description for this fix.BranchedSuggestedFixes.Builder.startWith
(SuggestedFix fix) SuggestedFix.Builder.swap
(Tree node1, Tree node2, VisitorState state) BranchedSuggestedFixes.Builder.then()
-
Uses of CanIgnoreReturnValue in com.google.errorprone.matchers
Methods in com.google.errorprone.matchers with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionDescription.Builder.addAllFixes
(List<? extends Fix> fixes) Add each fix in order.Adds a suggested fix for thisDescription
.Deprecated.prefer referring to empty fixes usingSuggestedFix.emptyFix()
.Description.Builder.overrideSeverity
(BugPattern.SeverityLevel severity) Description.Builder.setLinkUrl
(String linkUrl) Set a custom link URL.Description.Builder.setMessage
(String message) Set a custom error message for thisDescription
. -
Uses of CanIgnoreReturnValue in com.google.errorprone.refaster
Methods in com.google.errorprone.refaster with annotations of type CanIgnoreReturnValueModifier and TypeMethodDescriptionstatic <T> T
Refaster.anyOf
(T... expressions) Indicates that Refaster should attempt to match a target expression against each of the specified template expressions, in order, and succeed at the first match.@Nullable Object
Bindings.put
(Bindings.Key<?> key, Object value) <V> V
Bindings.putBinding
(Bindings.Key<V> key, V value) <V> V
Unifier.putBinding
(Bindings.Key<V> key, V value) -
Uses of CanIgnoreReturnValue in com.google.errorprone.scanner
Methods in com.google.errorprone.scanner with annotations of type CanIgnoreReturnValue
BugCheckerRefactoringTestHelper.ExpectOutput.addOutputLines(String, String...)
.