Uses of Annotation Type
com.google.errorprone.annotations.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
Modifier and TypeMethodDescriptionBugCheckerRefactoringTestHelper.addModules
(String... modules) CompilationTestHelper.addModules
(String... modules) CompilationTestHelper.addSourceFile
(String path) Adds a source file to the test compilation, from an existing resource file.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.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
Modifier and TypeMethodDescriptionImportOrganizer.OrganizedImports.addGroups
(Map<K, ? extends Collection<ImportOrganizer.Import>> groups, Iterable<K> keys) Add groups of already sorted imports. -
Uses of CanIgnoreReturnValue in com.google.errorprone.bugpatterns
Modifier 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
Modifier 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
Modifier 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.ThreadSafety.KnownTypes.MapBuilder.addAll
(com.google.common.collect.ImmutableMap<String, AnnotationInfo> map) ThreadSafety.KnownTypes.MapBuilder.addClasses
(Set<Class<?>> clazzs) ThreadSafety.KnownTypes.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
(ThreadSafety.KnownTypes 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
Modifier and TypeMethodDescriptionAccessPathStore.Builder.setInformation
(AccessPath aPath, V value) -
Uses of CanIgnoreReturnValue in com.google.errorprone.fixes
Modifier 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.delete
(com.sun.source.tree.Tree node) SuggestedFix.Builder.merge
(SuggestedFix other) Merges all edits fromother
intothis
.SuggestedFix.Builder.merge
(SuggestedFix.Builder other) Merges all edits fromother
intothis
.SuggestedFix.Builder.postfixWith
(com.sun.source.tree.Tree node, String postfix) SuggestedFix.Builder.prefixWith
(com.sun.source.tree.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
(com.sun.source.tree.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
(com.sun.source.tree.Tree node1, com.sun.source.tree.Tree node2) BranchedSuggestedFixes.Builder.then()
-
Uses of CanIgnoreReturnValue in com.google.errorprone.matchers
Modifier and TypeMethodDescriptionDescription.Builder.addAllFixes
(List<? extends Fix> fixes) Add each fix in order.Adds a suggested fix for thisDescription
.Deprecated.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
Modifier 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.Bindings.put
(Bindings.Key<?> key, Object value) -
Uses of CanIgnoreReturnValue in com.google.errorprone.scanner
SuggestedFix.emptyFix()
.