Uses of Class
com.google.errorprone.bugpatterns.BugChecker
Package
Description
Checks added to the java compiler which detect common bug patterns.
Bug patterns related to dependency
injection and JSR 330.
Bug patterns related to Dagger.
Bug patterns related to Guice.
-
Uses of BugChecker in com.google.errorprone
Modifier and TypeMethodDescriptionvoid
VisitorState.incrementCounter
(BugChecker bugChecker, String key) Increment the counter for a combination ofbugChecker
's canonical name andkey
by 1.void
VisitorState.incrementCounter
(BugChecker bugChecker, String key, int count) Increment the counter for a combination ofbugChecker
's canonical name andkey
bycount
.BugCheckerRefactoringTestHelper.newInstance
(BugChecker refactoringBugChecker, Class<?> clazz) Deprecated.Modifier and TypeMethodDescriptionstatic BugCheckerInfo
BugCheckerInfo.create
(Class<? extends BugChecker> checker) BugCheckerRefactoringTestHelper.newInstance
(Class<? extends BugChecker> checkerClass, Class<?> clazz) static CompilationTestHelper
CompilationTestHelper.newInstance
(Class<? extends BugChecker> checker, Class<?> clazz) Returns a newCompilationTestHelper
. -
Uses of BugChecker in com.google.errorprone.bugpatterns
Modifier and TypeClassDescriptionclass
Check for usage ofSet<T>
orMap<T, E>
.class
An abstract class that detects use of the unsafe APIs.class
AbstractMockChecker<T extends Annotation>
Helper for enforcing Annotations that disallow mocking.class
An abstract check for resources that must be closed; used byStreamResourceLeak
andMustBeClosedChecker
.class
Finds calls to regex-accepting methods with literal strings.class
Abstract implementation of a BugPattern that detects the use of reference equality to compare classes with value semantics.class
An abstract base class to match API usages in which the return value is not used.class
An abstract matcher for implicit and explicit calls toObject.toString()
, for use on types that do not have a human-readabletoString()
implementation.class
Helper for refactoring from if-else chains to switches.final class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Bugpattern to find conditions which are checked more than once.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Detects occurrences of pairs of parameters being passed straight through toString.format(java.lang.String, java.lang.Object...)
from a method not annotated withFormatMethod
.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Checks annotation positioning, and orphaned Javadocs.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Warns that users should not have an array as a key to a Set or Mapclass
class
Checks when Arrays.fill(Object[], Object) is called with object types that are guaranteed to result in an ArrayStoreException.class
final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
A BugPattern; see the summaryfinal class
Checks thatAsyncCallable
implementations do not directlyreturn null
.final class
Checks thatAsyncFunction
implementations do not directlyreturn null
.class
A BugPattern; see the summary.class
See summary for details.final class
See summary for details.class
Checks the toString(), hashCode() and equals() methods are final in AutoValue classes.class
Flags mutable collections in AutoValue.final class
MatchesAutoValue_
uses outside the containing file.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Checker that ensures implementations ofAnnotation
override equals and hashCode.class
class
final class
Matches instanceof checks where the expression is a subtype of the checked type.class
final class
ABugChecker
that detects use of the unsafe JNDI API system.final class
ABugChecker
that detects use of the unsafe JNDI API system.final class
ABugChecker
that detects use of the unsafeSerializable
API.class
A BugChecker; see the associated BugPattern for details.final class
Matches use ofBigDecimal#equals
, which compares scale as well (which is not likely to be intended).class
Matches usages ofnew BigDecimal(double)
which lose precision.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
See thesummary
.class
Checks when ByteBuffer.array() is used without calling .arrayOffset() to know the offset of the array, or when the buffer wasn't initialized using ByteBuffer.wrap() or ByteBuffer.allocate().class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Bug pattern to recognize attempts to mock final types.final class
A BugPattern; see the summaryclass
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags code which catchesRuntimeException
s under the guise of catchingException
.final class
Identifies calls toassertThat
and similar methods inside the implementation of aSubject
assertion method.final class
Checks, if two constructors in a class both acceptFoo foo
and one calls the other, that the caller passesfoo
as a parameter.class
Checks for use of Character.getNumericValue and UCharacter.getNumericValuefinal class
Flags checked exceptions which are claimed to be thrown, but are not.final class
Checks for the same variable being checked against null twice in a method.class
class
class
See the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
class
class
final class
Suggests comparing the result ofcompareTo
to only0
.class
Check for expressions containingthis != null
orthis == null
class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
A Bugpattern; see the accompanying Markdown documentation.class
final class
Flags ambiguous creations of objects inMap.computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>)
.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags variables initialized withPattern.compile(String)
calls that could be constants.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
A checker that suggests deduplicating literals with existing constant variables.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Java classes shouldn't use default package.class
Matches the behaviour of the javac dep-ann Xlint warning.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Discourages using multiple names to refer to the same type within a file (e.g.final class
A bugpattern; see the description.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ErrorProne checker to generate warning when method expecting distinct varargs is invoked with same variable argument.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
If a method always throws an exception, consider annotating it with@DoNotCall
to prevent calls at compile-time instead failing at runtime.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Suggests not mocking AutoValue classes.class
Points out if a Mockito or EasyMock mock is mocking an object that would be better off being tested using an alternative instance.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flag DateFormats which use the same field more than once.class
Flags duplicate keys used in ImmutableMap construction.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
This checker finds and fixes empty statements after an if, with no else part.final class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Discourages the use ofEnum.ordinal()
and other ways to access enum values by index.final class
Discourages the use ofObject.getClass()
when implementingObject.equals(Object)
for non-final classes.class
Classes that overrideObject.equals(java.lang.Object)
should also overrideObject.hashCode()
.class
class
final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
Checks forequals
implementations making unsafe casts.final class
Discourages implementingequals
usinghashCode
.final class
Checks forequals
implementations comparing non-corresponding fields.final class
A BugPattern; see the summary.final class
ErrorProne checker to generate warning wheneverThreadPoolExecutor
is constructed with differentcorePoolSize
andmaximumPoolSize
using an unboundedworkQueue
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
Makes sure that you are not extending a class that has @AutoValue as an annotation.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
Flags fields which can be replaced with local variables.final class
Finds fields which can be safely made static.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Matches the behaviour of javac's finally Xlint warning.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Detects usages ofFloat,DoubleSubject.isWithin(TOLERANCE).of(EXPECTED)
where there are no other floating point values other thanEXPECTED
with satisfy the assertion, butTOLERANCE
is not zero.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Verifies that methods markedForOverride
are only called from the defining class.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
See BugPattern annotation.final class
Checks for calls to Guava'sFutures.getChecked
method that will always fail because they pass an incompatible exception type.final class
See summary for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags a few ways in which member names may violate the style guide.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags ignored return values from pure getters.final class
Refactoring to suggest Immutable types for member collection that are not mutated.final class
Refactoring to suggest usingprivate static final
ImmutableSet
overImmutableList
when using only contains, containsAll and isEmpty.final class
Migrates Truth subjects from a manual "test and fail" approach to one usingSubject.check(...)
.final class
Matches comparison of proto fields tonull
.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
Checker for variables under the same scope that only differ in capitalization.final class
Looks for hashCode implementations which are inconsistent with equals.final class
Bugpattern for incorrect overloads of main.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Bugpattern to encourage initializing effectively final variables inline with their declaration, if possible.final class
A BugPattern; see the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Checks that InputStreams should override int read(byte[], int, int);class
class
final class
Bugpattern to detect interfaces used only to store static fields/methods.final class
Checks for cases where anInterruptedException
is caught as part of a catch block catching a supertype, and not specially handled.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
class
Validates ZoneId.final class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Detects floating-point assertEquals() calls that will not work in JUnit 4.final class
A bugpattern; see the associated summary.class
@BeforeClass
or@AfterClass
should be applied to static methods.class
class
Checks for the existence of a JUnit3 style setUp() method in a JUnit4 test class or methods annotated with a non-JUnit4 @Before annotation.class
Checks for the existence of a JUnit3 style tearDown() method in a JUnit4 test class or methods annotated with a non-JUnit4 @After annotation.class
final class
Finds tests that won't run due to the enclosing runner.class
class
Points out if an object is tested for reference equality to itself using JUnit library.class
Checks if the methods specified injunitparams.Parameters
annotation to provide parameters exists.class
A BugPattern; see the summary.class
final class
A BugPattern; see the summary.class
class
Points out if #valueOf() is called on a Protocol Buffer Enum.final class
Flags calls totoString
on lite protos.final class
Suggests that calls toLock.lock
must be immediately followed by atry-finally
that callsLock.unlock
.class
Detects locks on boxed primitives.class
Bug checker to detect the usage of lock on the class other than the enclosing class of the code block.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Matcher for along
literal with a lower-case ell for a suffix (e.g.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Checker to prevent usages of comparison methods where both the operands undergo lossy widening.final class
final class
Check for calls to Math'sMath.round(float)
with an integer or long parameter.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
See the summary.final class
See the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
Matches test helpers which require a terminating method to be called.class
Base class for checks which find common errors in date format patterns.final class
Ban use of D (day-of-year) in a date format pattern that also contains M (month-of-year).final class
Ban use of YYYY in a SimpleDateFormat pattern, unless it is being used for a week date.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Checks for calls toDescriptor#findFieldByNumber
with field numbers from a different proto.final class
Flags methods which return mutable collections from some code paths, but immutable ones from others.final class
A BugPattern; see the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
A BugPattern; see the summary.class
Matches creation of new collections/proto builders which are modified but never used.class
class
class
Identify the backing collection source of a stream and reports if the source is mutated during the stream operations.final class
A BugPattern; see the summary.class
final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Checks if a constructor or method annotated withMustBeClosed
is called within the resource variable initializer of a try-with-resources statement.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Check for public static final declaration of Arrays.final class
Warns on classes or methods being named similarly to contextual keywords, or invoking such methods.final class
A BugPattern; see the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Checks methods annotated with@NoAllocation
to ensure they really do not allocate.final class
Flags instances of non-API types from being accepted or returned in APIs.class
Detects non-atomic updates to volatile variables.class
Types shouldn't be statically by their non-canonical name.class
Members shouldn't be statically imported by their non-canonical name.final class
Flags types being referred to by their non-canonical name.class
Enforce that @CompileTimeConstant parameters are final or effectively final.final class
A BugPattern; see the summary.class
Bug checker for equals methods that don't actually override equals.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
A bugpattern; see the summary.final class
class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags passing literal null toOptional
-accepting APIs.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Check for usage ofObjects.equal
on primitive types.final class
Check for calls to Objects'Objects.hashCode(java.lang.Object)
with a primitive parameter.class
Warns against calling toString() on Objects which don't have toString() method overridden and won't produce meaningful output.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
MatchesOptional#map
mapping to anotherOptional
.final class
ReplacesOptional.map
withOptional.ifPresent
if the value is unused.final class
class
Checks ifOptional#of
is chained with a redundant method.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Check for the a11y antipattern of setting CSS outline attributes to none or 0.class
Matches the behaviour of javac's overrides Xlint warning.final class
Warns against overriding toString() in a Throwable class and suggests getMessage()class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags uses of parameters in non-parameterized tests.final class
A BugPattern; see the summary.class
Checks that Precondition.checkNotNull is not invoked with same arg twice.class
final class
Tightens types which refer to an Iterable, Map, Multimap, etc.class
final class
Discourages inadvertently using reference equality on boxed primitives in AtomicReference.final class
class
Check for disallowed access to private_do_not_access_or_else proto fields.class
Flags protected members in final classes.final class
Highlights cases where a proto's build method has its return value ignored.class
Points out if #ordinal() is called on a Protocol Buffer Enum.class
final class
Checks thatProtoTruth
'signoringFields
is passed field numbers from the correct proto.class
Checks if public APIs named "stream" returns a type whose name ends with Stream.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Removes overrides which purely pass through to the method in the super class.final class
A BugPattern; see the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
class
class
Check for non-allowlisted callers to RestrictedApiChecker.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Flags methods with collection return types which returnnull
in some cases but don't annotate the method as @Nullable.class
A checker which produces an error when a return value is accidentally discarded.class
ABugChecker
; see the summary.final class
ABugChecker
; see the associatedBugPattern
for details.final class
Looks for types being shadowed by other types in a way that may be confusing.final class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugPattern
; see the summary.class
TODO(eaftan): Consider cases where the parent is not a statement or there is no parent?class
Points out if an object is compared to itself.class
final class
A BugPattern; see the summary.class
class
Checks that variable argument methods have even number of arguments.class
Finds instances where one usesCollection#size() >= 0
orT[].length > 0
.final class
Checks for statement switches that can be expressed as an equivalent expression switch.final class
Checks for static fields being assigned within constructors.final class
Checks for static fields being assigned withThrowable
.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Discouragestream::iterator
to createIterable
s.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
ABugChecker
that flags calls toString.toLowerCase()
andString.toUpperCase()
, as these methods implicitly rely on the environment's default locale.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags fields which would be better expressed as ByteStrings rather than primitive byte arrays.final class
Check for calls to String'sfoo.substring(0)
.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Find uses of SuppressWarnings with "deprecated".final class
Finds occurrences of@SuppressWarnings
where there is definitely no explanation for why it is safe.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Flagsjavax.lang.model.element.Element#toString
usage inBugChecker
s.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Check for calls toSystem.exit()
outside of a main method.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags uses of parameters in non-parameterized tests.final class
Flags uses of@Theory
(and others) in non-Theories
-run tests.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
A BugPattern; see the summary.class
A BugPattern; see the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Bugpattern to discourage throwing base exception classes.class
Suggests to remove the unchecked throws clause.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ToString should not return null.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Warns against use of bothstatic
andtransient
modifiers on field declarations.class
Flagscom.sun.source.tree.Tree#toString
usage inBugChecker
s.final class
Detects usages of Truth assertions with the expected and actual values reversed.class
Points out if Truth Library assert is called on a constant.final class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags ambiguous usages ofMap#getOrDefault
withinTruth#assertThat
.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
A bug checker for the following code pattern:class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Flags com.sun.tools.javac.code.Type#equals usage.class
Warns when a type parameter shadows another type name in scope.class
Enforces type parameters match the google style guide.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
class
Flagsjavax.lang.model.type.TypeMirror#toString
usage inBugChecker
s.final class
Flags types which do not have well-defined equals behavior.class
final class
Bans, without the possibility of suppression, the use of direction-changing Unicode escapes.final class
Replaces printable ASCII unicode escapes with the literal version.final class
Bans using non-ASCII Unicode characters outside string literals and comments.final class
Flags uses of fully qualified names which are not ambiguous if imported.final class
Suggests restricting the visibility of methods which should only be called by a framework.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Discourage manual initialization or assignment to fields annotated with framework annotations.final class
A BugPattern; see the summary.class
Finds and fixes unnecessarily boxed return expressions.class
Finds and fixes unnecessarily boxed variables.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Removesfinal
from non-field variables.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Matchers.methodInvocation(Matcher)
is not exactly deprecated, but it is legacy, and in particular is not needed when the argument is a MethodMatcher, since MethodMatcher already does the unwrapping that methodInvocation does.final class
Matches unnecessary uses of method references.final class
A refactoring to replace Optional.get() with lambda arg in expressions passed as arg to member functions of Optionals.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
See the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
Flags unsafe usages of theLocale
constructor and class methods.class
Checks unsafe instance creation via reflection.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
final class
Bugpattern for catch blocks which catch an exception but throw another one without wrapping the original.final class
A BugPattern; see the summary.final class
Bugpattern to detect unused declarations.final class
Bugpattern to detect unused nested classes.final class
A BugPattern; see the summary.final class
Bugpattern to detect unused declarations.class
Points out on creation of Set and HashMap of type java.net.URL.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Check for variables and types with the same namefinal class
Converts some local variables to usevar
.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
A BugPattern; see the summary.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
MethodMatchers.MethodClassMatcher.withSignature(String)
is discouraged: most usages should use .named and/or .withParameters instead.final class
Matches always-default expressions in oneof switches.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
See the summary.Modifier and TypeMethodDescriptionstatic StronglyType.Builder
StronglyType.forCheck
(BugChecker bugChecker) -
Uses of BugChecker in com.google.errorprone.bugpatterns.android
Modifier and TypeClassDescriptionclass
class
class
class
class
class
class
Replacement of misleading android.R.string constants with more intuitive ones.class
BugPattern to detect classes which implement android.os.Parcelable but don't have public static CREATOR.final class
class
class
-
Uses of BugChecker in com.google.errorprone.bugpatterns.apidiff
Modifier and TypeClassDescriptionclass
Checks for uses of classes, fields, or methods that are not compatible with legacy Android devices.class
A base Error Prone check implementation to enforce compliance with a given API diff.class
Checks for uses of classes, fields, or methods that are not compatible with JDK 7class
Checks for uses of classes, fields, or methods that are not compatible with JDK 8 -
Uses of BugChecker in com.google.errorprone.bugpatterns.argumentselectiondefects
Modifier and TypeClassDescriptionclass
Checks the lexical distance between method parameter names and the argument names at call sites.final class
Checker to make sure that assertEquals-like methods are called with the arguments expected and actual the right way round.final class
Checker to make sure that constructors for AutoValue types are invoked with arguments in the correct order. -
Uses of BugChecker in com.google.errorprone.bugpatterns.checkreturnvalue
Modifier and TypeClassDescriptionclass
Discourages builder instance methods that do not return 'this'.final class
Checker that recommends annotating a method with@CanIgnoreReturnValue
if the method returnsthis
, returns an effectively final input param, or if it looks like a builder method (that is likely to returnthis
).final class
Checker that "pushes" the@CanIgnoreReturnValue
annotation down from classes to methods.final class
Checker that warns when capturing the result of an ignorable API into anunused
variable.final class
Checker that recommends using ErrorProne's version of@CheckReturnValue
over the version in JSR305 (which is defunct). -
Uses of BugChecker in com.google.errorprone.bugpatterns.collectionincompatibletype
Modifier and TypeClassDescriptionclass
Checker for calling Object-accepting methods with types that don't match the type arguments of their container types.final class
Highlights use ofCollection#contains
(and others) with types that do not have well-defined equals.class
class
final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details. -
Uses of BugChecker in com.google.errorprone.bugpatterns.flogger
Modifier and TypeClassDescriptionclass
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
Detects invocations ofLoggingApi.log(String)
for which the argument is not a compile-time constant and provides suggested alternatives.final class
final class
Flags cases where there is an exception available that could be set as the cause in a log message.class
class
final class
Ensures that class-level FluentLogger objects are private static final.final class
Bugpattern to prevent splitting flogger log invocations into multiple statements.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Flogger's withCause(Throwable) method checksclass
Detects Flogger log statements that pass Exceptions to the log method instead of using withCause. -
Uses of BugChecker in com.google.errorprone.bugpatterns.formatstring
Modifier and TypeClassDescriptionclass
ABugChecker
; see the associatedBugPattern
annotation for details.final class
BugChecker
to assert validity of methods calls withFormatString
annotations.class
ABugChecker
; see the associatedBugPattern
annotation for details. -
Uses of BugChecker in com.google.errorprone.bugpatterns.inject
Modifier and TypeClassDescriptionclass
class
class
class
class
A checker for injected constructors with @Inject(optional=true) or binding annotations.class
class
Checks if class constructor and members are both annotated as @Inject.class
class
class
class
Bug checker for when a scope annotation is used at injection site, which does not have any effect on the injected values.class
class
Matches classes that have two or more constructors annotated with @Inject.class
class
This checker matches if a class has more than one annotation that is a scope annotation(that is, the annotation is either annotated with Guice's@ScopeAnnotation
or Javax's@Scope
).class
class
class
class
-
Uses of BugChecker in com.google.errorprone.bugpatterns.inject.dagger
Modifier and TypeClassDescriptionfinal class
final class
class
class
Bug checker for null-returning methods annotated with@Provides
but not@Nullable
.final class
Checks that the only code that refers to Dagger generated code is other Dagger generated code.final class
Migrate users who use JSR 330 scopes on Dagger modules.class
-
Uses of BugChecker in com.google.errorprone.bugpatterns.inject.guice
Modifier and TypeClassDescriptionclass
This checker matches iff *both* of the following conditions are true: 1) The class is assisted: a) If there is a constructor that is annotated with @Inject and that constructor has at least one parameter that is annotated with @Assisted.class
class
class
class
This checker matches methods that 1) are not themselves annotated with @Inject (neither javax.inject.Inject nor com.google.inject.Inject) 2) descend from a method that is annotated with @com.google.inject.Injectclass
This checker matches methods that 1) are not themselves annotated with @Inject 2) descend from a method that is annotated with @javax.inject.Inject 3) do not descent from a method that is annotated with @com.google.inject.Injectclass
-
Uses of BugChecker in com.google.errorprone.bugpatterns.inlineme
Modifier and TypeClassDescriptionfinal class
Checker that performs the inlining at call-sites (where the invoked APIs are annotated as@InlineMe
).final class
Checker that recommends using@InlineMe
on single-statement deprecated APIs.final class
Checker that ensures the@InlineMe
annotation is used correctly. -
Uses of BugChecker in com.google.errorprone.bugpatterns.javadoc
Modifier and TypeClassDescriptionfinal class
Flags comments which appear to be intended to be Javadoc, but are not started with an extra*
.final class
Matches block tags (@param, @return, @throws, @deprecated) with an empty description.final class
Finds unescaped entities in Javadocs.final class
Matches invalid usage of @inheritDoc.final class
Matches invalid Javadoc tags, and tries to suggest fixes.final class
Matches invalid Javadoc tags, and tries to suggest fixes.final class
Finds some common errors in @link tags.final class
Matches incorrect Javadoc @param tags.final class
Matches errors in Javadoc @throws tags.final class
Matches misuse of link tags within throws tags.final class
Finds malformed inline tags where @{tag is used instead of {@tag.final class
Matches Javadocs which are missing a required summary line.final class
A BugPattern; see the summary.final class
Finds common Javadoc errors, and tries to suggest useful fixes.final class
Finds unescaped entities in Javadocs.final class
Flags tags which haven't been recognised by the Javadoc parser.final class
Discourages using URLs in @see tags. -
Uses of BugChecker in com.google.errorprone.bugpatterns.nullness
Modifier and TypeClassDescriptionfinal class
ABugChecker
; see the associatedBugPattern
annotation for details.class
BugChecker
adds a null check toequals()
method implementations which don't satisfy the null contract ofObject.equals(java.lang.Object)
i.e.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
A bugpattern: see the summary.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.final class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Checks for unnecessarily performing null checks on expressions which can't be null.class
Check to detect unsafe upcasts ofnull
values to wildcard types.class
ABugChecker
; see the associatedBugPattern
annotation for details. -
Uses of BugChecker in com.google.errorprone.bugpatterns.overloading
Modifier and TypeClassDescriptionfinal class
ABugChecker
that detects inconsistently overloaded methods in Java classes. -
Uses of BugChecker in com.google.errorprone.bugpatterns.threadsafety
Modifier and TypeClassDescriptionclass
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
ABugChecker
; see the associatedBugPattern
annotation for details.class
Bug checker to detect usage ofThread.stop()
,Thread.yield()
, and changing thread priorities.class
ABugChecker
; see the associatedBugPattern
annotation for details.ModifierConstructorDescriptionThreadSafeAnalysis
(BugChecker bugChecker, VisitorState state, WellKnownThreadSafety wellKnownThreadSafety) -
Uses of BugChecker in com.google.errorprone.bugpatterns.time
Modifier and TypeClassDescriptionfinal class
Warns against suspect looking calls toDate
APIs.final class
final class
Bans calls toDuration.get(temporalUnit)
wheretemporalUnit
is notSECONDS
orNANOS
.final class
Bans calls toDuration
APIs where theTemporalUnit
is notChronoUnit.DAYS
or it has an estimated duration (which is guaranteed to throw anDateTimeException
).final class
Reports an error when a Duration or Instant is incorrectly decomposed in order to call an API which accepts a<long, TimeUnit>
pair.final class
Bans calls tojavaTimeType.from(temporalAmount)
where the call is guaranteed to either: throw aDateTimeException
at runtime (e.g.,LocalDate.from(month)
) return the same parameter (e.g.,Instant.from(instant)
)final class
Bans calls toInstant
APIs where theTemporalUnit
is not one of:NANOS
,MICROS
,MILLIS
,SECONDS
,MINUTES
,HOURS
,HALF_DAYS
, orDAYS
.final class
This checker errors on calls tojava.time
methods using values that are guaranteed to throw aDateTimeException
.final class
This checker warns about calls toduration.getNano()
without a corresponding "nearby" call toduration.getSeconds()
.final class
Error prone checking forDuration.getSeconds()
withoutDuration.getNano()
.final class
Check for calls toduration.withNanos(int)
.final class
Check for calls toduration.withSeconds(long)
.final class
This checker warns about calls toinstant.getNano()
without a corresponding "nearby" call toinstant.getEpochSecond()
.final class
This checker warns about calls toLocalDateTime.getNano()
without a corresponding "nearby" call toLocalDateTime.getSecond()
.final class
This checker warns about calls toLocalTime.getNano()
without a corresponding "nearby" call toLocalTime.getSecond()
.final class
This checker warns about calls toperiod.getDays()
without a corresponding "nearby" call toperiod.getYears(), period.getMonths(), or period.getTotalMonths()
.final class
Check for calls tojava.time
APIs that silently use the default system time-zone.final class
Check for calls to bad JodaTime constructors.final class
Checks for usages of dangerousDateTimeConstants
constants.final class
Check for calls toduration.withMillis(long)
.final class
Check for calls toinstant.withMillis(long)
.final class
Match possibly incorrect use of Period to obtain a number of (e.g.) days between two dates.final class
Check for calls to JodaTime'stype.plus(long)
andtype.minus(long)
where<type> = {Duration,Instant,DateTime,DateMidnight}
.final class
Ban usage of Joda'sConverterManager
.final class
Check for calls to Joda-Time'sfoo.toFoo()
andnew Foo(foo)
.final class
Check for calls to JodaTime'stype.withDurationAdded(long, int)
where<type> = {Duration,Instant,DateTime}
.final class
Bans calls toLocalDate.plus(TemporalAmount)
andLocalDate.minus(TemporalAmount)
where theTemporalAmount
is a non-zeroDuration
.final class
final class
Bans calls toPeriod.get(temporalUnit)
wheretemporalUnit
is notYEARS
,MONTHS
, orDAYS
.final class
Bans calls toPeriod#plus/minus(TemporalAmount)
where the argument is a Duration.final class
This check suggests the use ofjava.time
-based APIs, when available.final class
This checker warns about accessing the underlying nanosecond-adjustment field of a duration without a "nearby" access of the underlying seconds field.final class
This checker warns about accessing the underlying nanosecond-adjustment field of a protobuf timestamp without a "nearby" access of the underlying seconds field.final class
Flags fields which would be better expressed as time types rather than primitive integers.final class
Bans calls toTemporalAccessor.get(ChronoField)
where the implementation is guaranteed to throw anUnsupportedTemporalTypeException
.final class
Check for problematic or suspicious TimeUnit conversion calls.final class
Checker that detects likely time-unit mismatches by looking at identifier names.final class
This checker bans calls toZoneId.of("Z")
in favor ofZoneOffset.UTC
. -
Uses of BugChecker in com.google.errorprone.scanner
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet
<BugChecker> ErrorProneScanner.getBugCheckers()
Modifier and TypeMethodDescriptionstatic ScannerSupplier
ScannerSupplier.fromBugCheckerClasses
(Iterable<Class<? extends BugChecker>> checkers) Returns aScannerSupplier
with a specific list ofBugChecker
classes.static com.google.common.collect.ImmutableSet
<BugCheckerInfo> BuiltInCheckerSuppliers.getSuppliers
(Iterable<Class<? extends BugChecker>> checkers) ModifierConstructorDescriptionErrorProneScanner
(BugChecker... checkers) Create an error-prone scanner for the given checkers.ModifierConstructorDescriptionErrorProneScanner
(Iterable<BugChecker> checkers) Create an error-prone scanner for a non-hardcoded set of checkers.ErrorProneScanner
(Iterable<BugChecker> checkers, Map<String, BugPattern.SeverityLevel> severities) Create an error-prone scanner for a non-hardcoded set of checkers.
BugCheckerRefactoringTestHelper.newInstance(Class, Class)