Uses of Interface
com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher
Packages that use BugChecker.MethodInvocationTreeMatcher
Package
Description
Checks added to the java compiler which detect common bug patterns.
Bug patterns related to Dagger.
Bug patterns related to Guice.
-
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns
Classes in com.google.errorprone.bugpatterns that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionclassCheck for usage ofSet<T>orMap<T, E>.classAbstractMockChecker<T extends Annotation>Helper for enforcing Annotations that disallow mocking.classFinds calls to regex-accepting methods with literal strings.classAn abstract base class to match API usages in which the return value is not used.classAn abstract matcher for implicit and explicit calls toObject.toString(), for use on types that do not have a human-readabletoString()implementation.final classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classWarns that users should not have an array as a key to a Set or MapclassclassChecks when Arrays.fill(Object[], Object) is called with object types that are guaranteed to result in an ArrayStoreException.classclassclassclassABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classA BugPattern; see the summaryfinal classABugCheckerthat detects use of the unsafe JNDI API system.final classABugCheckerthat detects use of the unsafe JNDI API system.final classABugCheckerthat detects use of the unsafeSerializableAPI.classA BugChecker; see the associated BugPattern for details.final classMatches use ofBigDecimal#equals, which compares scale as well (which is not likely to be intended).classABugChecker; see the associatedBugPatternannotation for details.classChecks 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().classBug pattern to recognize attempts to mock final types.final classA BugPattern; see the summaryclassABugChecker; see the associatedBugPatternannotation for details.final classIdentifies calls toassertThatand similar methods inside the implementation of aSubjectassertion method.final classChecks, if two constructors in a class both acceptFoo fooand one calls the other, that the caller passesfooas a parameter.classChecks for use of Character.getNumericValue and UCharacter.getNumericValueclassclassABugChecker; see the associatedBugPatternannotation for details.classclassfinal classSuggests comparing the result ofcompareToto only0.classA Bugpattern; see the accompanying Markdown documentation.final classFlags ambiguous creations of objects inMap.computeIfAbsent(K, Function).classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.final classErrorProne checker to generate warning when method expecting distinct varargs is invoked with same variable argument.final classSuggests not mocking AutoValue classes.classPoints out if a Mockito or EasyMock mock is mocking an object that would be better off being tested using an alternative instance.final classFlag DateFormats which use the same field more than once.classFlags duplicate keys used in ImmutableMap construction.final classDiscourages the use ofEnum.ordinal()and other ways to access enum values by index.final classDiscourages the use ofObject.getClass()when implementingObject.equals(Object)for non-final classes.classfinal classABugChecker; see the associatedBugPatternannotation for details.final classDiscourages implementingequalsusinghashCode.classError checker for calls to the Preconditions class in Guava which use 'expensive' methods of producing the error string.final classABugChecker; see the summary.final classDetects usages ofFloat,DoubleSubject.isWithin(TOLERANCE).of(EXPECTED)where there are no other floating point values other thanEXPECTEDwith satisfy the assertion, butTOLERANCEis not zero.classVerifies that methods markedForOverrideare only called from the defining class.final classSee BugPattern annotation.final classChecks for calls to Guava'sFutures.getCheckedmethod that will always fail because they pass an incompatible exception type.final classSee summary for details.classclassABugChecker; see the associatedBugPatternannotation for details.classclassABugChecker; see the associatedBugPatternannotation for details.final classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.final classFlags ignored return values from pure getters.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classclassABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classclassclassValidates ZoneId.final classclassABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classDetects floating-point assertEquals() calls that will not work in JUnit 4.classclassPoints out if an object is tested for reference equality to itself using JUnit library.classclassPoints out if #valueOf() is called on a Protocol Buffer Enum.final classFlags calls totoStringon lite protos.final classSuggests that calls toLock.lockmust be immediately followed by atry-finallythat callsLock.unlock.classDetects locks on boxed primitives.final classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classChecker to prevent usages of comparison methods where both the operands undergo lossy widening.final classfinal classCheck for calls to Math'sMath.round(float)with an integer or long parameter.final classSee the summary.final classA BugPattern; see the summary.classBase class for checks which find common errors in date format patterns.final classBan use of D (day-of-year) in a date format pattern that also contains M (month-of-year).final classBan use of YYYY in a SimpleDateFormat pattern, unless it is being used for a week date.final classChecks for calls toDescriptor#findFieldByNumberwith field numbers from a different proto.final classA BugPattern; see the summaryclassABugChecker; see the associatedBugPatternannotation for details.classclassclassIdentify the backing collection source of a stream and reports if the source is mutated during the stream operations.final classA BugPattern; see the summary.classclassfinal classWarns on classes or methods being named similarly to contextual keywords, or invoking such methods.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classChecks methods annotated with@NoAllocationto ensure they really do not allocate.classfinal classABugChecker; see the associatedBugPatternannotation for details.final classFlags passing literal null toOptional-accepting APIs.classCheck for usage ofObjects.equalon primitive types.final classCheck for calls to Objects'Objects.hashCode(Object)with a primitive parameter.classWarns against calling toString() on Objects which don't have toString() method overridden and won't produce meaningful output.final classMatchesOptional#mapmapping to anotherOptional.final classReplacesOptional.mapwithOptional.ifPresentif the value is unused.classChecks ifOptional#ofis chained with a redundant method.classCheck for the a11y antipattern of setting CSS outline attributes to none or 0.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classChecks that Precondition.checkNotNull is not invoked with same arg twice.classfinal classA BugPattern; see the summary.classfinal classDiscourages inadvertently using reference equality on boxed primitives in AtomicReference.classCheck for disallowed access to private_do_not_access_or_else proto fields.final classHighlights cases where a proto's build method has its return value ignored.classPoints out if #ordinal() is called on a Protocol Buffer Enum.final classChecks thatProtoTruth'signoringFieldsis passed field numbers from the correct proto.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.final classA BugPattern; see the summary.classCheck for non-allowlisted callers to RestrictedApiChecker.classA checker which produces an error when a return value is accidentally discarded.classABugChecker; see the summary.final classABugChecker; see the associatedBugPatternfor details.final classABugPattern; see the summary.classPoints out if an object is compared to itself.classfinal classA BugPattern; see the summary.final classA BugPattern; see the summary.classChecks that variable argument methods have even number of arguments.classABugChecker; see the associatedBugPatternannotation for details.final classABugCheckerthat flags calls toString.toLowerCase()andString.toUpperCase(), as these methods implicitly rely on the environment's default locale.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.final classABugChecker; see the associatedBugPatternannotation for details.final classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.final classCheck for calls to String'sfoo.substring(0).classABugChecker; see the associatedBugPatternannotation for details.classFlagsjavax.lang.model.element.Element#toStringusage inBugCheckers.classABugChecker; see the associatedBugPatternannotation for details.classCheck for calls toSystem.exit()outside of a main method.final classABugChecker; see the associatedBugPatternannotation for details.final classA check that bans using placeholders inThread.Builder.name(String)andThread.Builder.name(String, int).classclassclassA BugPattern; see the summary.classA BugPattern; see the summary.classFlagscom.sun.source.tree.Tree#toStringusage inBugCheckers.final classDetects usages of Truth assertions with the expected and actual values reversed.classPoints out if Truth Library assert is called on a constant.final classABugChecker; see the associatedBugPatternannotation for details.final classFlags ambiguous usages ofMap#getOrDefaultwithinTruth#assertThat.classFlags com.sun.tools.javac.code.Type#equals usage.classFlagsjavax.lang.model.type.TypeMirror#toStringusage inBugCheckers.final classFlags types which do not have well-defined equals behavior.classABugChecker; see the associatedBugPatternannotation for details.classMatchers.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 classA refactoring to replace Optional.get() with lambda arg in expressions passed as arg to member functions of Optionals.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details.final classFlags unsafe usages of theLocaleconstructor and class methods.classclassPoints out on creation of Set and HashMap of type java.net.URL.classclassMethodMatchers.MethodClassMatcher.withSignature(String)is discouraged: most usages should use .named and/or .withParameters instead.final classSee the summary. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.android
Classes in com.google.errorprone.bugpatterns.android that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionclassclassfinal classclass -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.argumentselectiondefects
Classes in com.google.errorprone.bugpatterns.argumentselectiondefects that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionclassChecks the lexical distance between method parameter names and the argument names at call sites.final classChecker to make sure that assertEquals-like methods are called with the arguments expected and actual the right way round. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.collectionincompatibletype
Classes in com.google.errorprone.bugpatterns.collectionincompatibletype that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionclassChecker for calling Object-accepting methods with types that don't match the type arguments of their container types.final classHighlights use ofCollection#contains(and others) with types that do not have well-defined equals.classfinal classABugChecker; see the associatedBugPatternannotation for details.classABugChecker; see the associatedBugPatternannotation for details. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.flogger
Classes in com.google.errorprone.bugpatterns.flogger that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionclassABugChecker; see the associatedBugPatternannotation for details.classclassDetects invocations ofLoggingApi.log(String)for which the argument is not a compile-time constant and provides suggested alternatives.final classclassclassChecks for usages ofperwithout a corresponding call toatMostEvery,every, oronAverageEveryin the same logging chain.final classEnsures that class-level FluentLogger objects are private static final.classABugChecker; see the associatedBugPatternannotation for details.classFlogger's withCause(Throwable) method checksclassDetects Flogger log statements that pass Exceptions to the log method instead of using withCause. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.formatstring
Classes in com.google.errorprone.bugpatterns.formatstring that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionfinal classA BugPattern; see the summary.classABugChecker; see the associatedBugPatternannotation for details.final classBugCheckerto assert validity of methods calls withFormatStringannotations.final classA BugPattern; see the summary. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.inject.dagger
Classes in com.google.errorprone.bugpatterns.inject.dagger that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionfinal classChecks that the only code that refers to Dagger generated code is other Dagger generated code. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.inject.guice
Classes in com.google.errorprone.bugpatterns.inject.guice that implement BugChecker.MethodInvocationTreeMatcher -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.inlineme
Classes in com.google.errorprone.bugpatterns.inlineme that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionfinal classChecker that performs the inlining at call-sites (where the invoked APIs are annotated as@InlineMe). -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.nullness
Classes in com.google.errorprone.bugpatterns.nullness that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionfinal classABugChecker; see the associatedBugPatternannotation for details.final classABugChecker; see the associatedBugPatternannotation for details.classA bug checker; see the summary.classChecks for unnecessarily performing null checks on expressions which can't be null.classCheck to detect unsafe upcasts ofnullvalues to wildcard types. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.threadsafety
Classes in com.google.errorprone.bugpatterns.threadsafety that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionclassABugChecker; see the associatedBugPatternannotation for details.classBug checker to detect usage ofThread.stop(),Thread.yield(), and changing thread priorities.classABugChecker; see the associatedBugPatternannotation for details. -
Uses of BugChecker.MethodInvocationTreeMatcher in com.google.errorprone.bugpatterns.time
Classes in com.google.errorprone.bugpatterns.time that implement BugChecker.MethodInvocationTreeMatcherModifier and TypeClassDescriptionfinal classWarns against suspect looking calls toDateAPIs.final classfinal classBans calls toDuration.get(temporalUnit)wheretemporalUnitis notSECONDSorNANOS.final classBans calls toDurationAPIs where theTemporalUnitis notChronoUnit.DAYSor it has an estimated duration (which is guaranteed to throw anDateTimeException).final classReports an error when a Duration or Instant is incorrectly decomposed in order to call an API which accepts a<long, TimeUnit>pair.final classBans calls tojavaTimeType.from(temporalAmount)where the call is guaranteed to either: throw aDateTimeExceptionat runtime (e.g.,LocalDate.from(month)) return the same parameter (e.g.,Instant.from(instant))final classBans calls toInstantAPIs where theTemporalUnitis not one of:NANOS,MICROS,MILLIS,SECONDS,MINUTES,HOURS,HALF_DAYS, orDAYS.final classThis checker errors on calls tojava.timemethods using values that are guaranteed to throw aDateTimeException.final classThis checker warns about calls toduration.getNano()without a corresponding "nearby" call toduration.getSeconds().final classError prone checking forDuration.getSeconds()withoutDuration.getNano().final classCheck for calls toduration.withNanos(int).final classCheck for calls toduration.withSeconds(long).final classThis checker warns about calls toinstant.getNano()without a corresponding "nearby" call toinstant.getEpochSecond().final classThis checker warns about calls toLocalDateTime.getNano()without a corresponding "nearby" call toLocalDateTime.getSecond().final classThis checker warns about calls toLocalTime.getNano()without a corresponding "nearby" call toLocalTime.getSecond().final classThis checker warns about calls toperiod.getDays()without a corresponding "nearby" call toperiod.getYears(), period.getMonths(), or period.getTotalMonths().final classCheck for calls tojava.timeAPIs that silently use the default system time-zone.final classCheck for calls toduration.withMillis(long).final classCheck for calls toinstant.withMillis(long).final classMatch possibly incorrect use of Period to obtain a number of (e.g.) days between two dates.final classCheck for calls to JodaTime'stype.plus(long)andtype.minus(long)where<type> = {Duration,Instant,DateTime,DateMidnight}.final classBan usage of Joda'sConverterManager.final classCheck for calls to Joda-Time'sfoo.toFoo()andnew Foo(foo).final classCheck for calls to JodaTime'stype.withDurationAdded(long, int)where<type> = {Duration,Instant,DateTime}.final classBans calls toLocalDate.plus(TemporalAmount)andLocalDate.minus(TemporalAmount)where theTemporalAmountis a non-zeroDuration.final classfinal classBans calls toPeriod.get(temporalUnit)wheretemporalUnitis notYEARS,MONTHS, orDAYS.final classBans calls toPeriod#plus/minus(TemporalAmount)where the argument is a Duration.final classThis check suggests the use ofjava.time-based APIs, when available.final classThis checker warns about accessing the underlying nanosecond-adjustment field of a duration without a "nearby" access of the underlying seconds field.final classThis checker warns about accessing the underlying nanosecond-adjustment field of a protobuf timestamp without a "nearby" access of the underlying seconds field.final classBans calls toTemporalAccessor.get(ChronoField)where the implementation is guaranteed to throw anUnsupportedTemporalTypeException.final classCheck for problematic or suspicious TimeUnit conversion calls.final classChecker that detects likely time-unit mismatches by looking at identifier names.final classThis checker bans calls toZoneId.of("Z")in favor ofZoneOffset.UTC.