All Versions
12
Latest Version
Avg Release Cycle
97 days
Latest Release
1572 days ago
Changelog History
Page 1
Changelog History
Page 1
-
v2.4.0
May 27, 2020 -
v2.3.4 Changes
December 02, 2019Performance Improvements : 40% speedup when run against Google's codebase with errors enabled.
🆕 New Checks :
- AlmostJavadoc
- BoxedPrimitiveEquality
- ChainedAssertionLosesContext
- CheckNotNullMultipleTimes
- DescribeMatch
- DoNotMockChecker and @DoNotMock
- DurationTemporalUnit
- EmptyBlockTag
- ExtendsAutoValue
- FieldCanBeLocal
- ImplementAssertionWithChaining
- Incomparable
- InstantTemporalUnit
- InterruptedExceptionSwallowed
- InvalidJavaTimeConstant
- JavaLocalDateTimeGetNano
- JavaLocalTimeGetNano
- JavaPeriodGetDays
- LiteEnumValueOf
- LiteProtoToString
- LocalDateTemporalAmount
- ModifySourceCollectionInStream
- ParametersButNotParameterized
- PreferJavaTimeOverload
- PrimitiveAtomicReference
- SameNameButDifferent
- TheoryButNoTheories
- ThrowSpecificExceptions
- TransientMisuse
- UnnecessaryAnonymousClass
- UnnecessaryBoxedAssignment
- UnnecessaryBoxedVariable
- UnnecessaryLambda
- UnnecessaryMethodInvocationMatcher
- WithSignatureDiscouraged
- XorPower
✂ Removed, moved, or disabled :
- 🚀 Moved Mockito checks into Mockito Error Prone Subproject.
- 🔀 Merged PreconditionsCheckNotNull and PreconditionsCheckNotNullPrimitive into UnnecessaryCheckNotNull.
- ✂ Deleted DeprecatedThreadMethods in favour of general-purpose deprecation warnings.
- Disabled ProvidesFixChecker as it causes too much noise.
🛠 Fixed issues : #1106, #1225, #1231, #1234, #1238, #1241, #1246, #1252, #1259, #1260, #1271, #1274, #1287, #1308, #1316, #1329, #1373, #1391, #1408
-
v2.3.3 Changes
March 20, 2019🆕 New checks:
- 🤡
AssignmentToMock
: Fields annotated with @mock should not be manually assigned to. AutoValueImmutableFields
: AutoValue recommends using immutable collectionsCompareToZero
: The result of #compareTo or #compare should only be compared to 0. It is an implementation detail whether a given type returns strictly the values {-1, 0, +1} or others.DeduplicateConstants
: This expression was previously declared as a constant; consider replacing this occurrence.DiscardedPostfixExpression
: The result of this unary operation on a lambda parameter is discardedDuplicateMapKeys
: Map#ofEntries will throw an IllegalArgumentException if there are any duplicate keysEscapedEntity
: HTML entities in @code/@literal tags will appear literally in the rendered javadoc.InheritDoc
: Invalid use of @inheritdoc.InterfaceWithOnlyStatics
: This interface only contains static fields and methods; consider making it a final class instead to prevent subclassing.InvalidBlockTag
: This tag is invalid.InvalidInlineTag
: This tag is invalid.MissingSummary
: A summary line is required on public/protected Javadocs.MixedDescriptors
: The field number passed into #getFieldByNumber belongs to a different proto to the Descriptor.MixedMutabilityReturnType
: This method returns both mutable and immutable collections or maps from different paths. This may be confusing for users of the method.- 🤡
MockitoInternalUsage
: org.mockito.internal.* is a private API and should not be used by clients OptionalMapToOptional
: Mapping to another Optional will yield a nested Optional. Did you mean flatMap?- 💅
OutlineNone
: Setting CSS outline style to none or 0 (while not otherwise providing visual focus indicators) is inaccessible for users navigating a web page without a mouse. PreconditionsCheckNotNullRepeated
: Including the first argument of checkNotNull in the failure message is not useful, as it will always benull
.- 🚚
RedundantOverride
: This override is redundant, and can be removed. RefersToDaggerCodegen
: Don't refer to Dagger's internal or generated code- ⏱
RxReturnValueIgnored
: Returned Rx objects must be checked. Ignoring a returned Rx value means it is never scheduled for execution TreeToString
: Tree#toString shouldn't be used for Trees deriving from the code being compiled, as it discards whitespace and comments.- ✅
TypeEquals
: com.sun.tools.javac.code.Type doesn't override Object.equals and instances are not interned by javac, so testing types for equality should be done with Types#isSameType instead UnescapedEntity
: Javadoc is interpreted as HTML, so HTML entities such as &, <, > must be escaped.UnusedMethod
: Unused.- 🚚
UnusedNestedClass
: This nested class is unused, and can be removed. UnusedVariable
: Unused.
🆕 New date and time related checks:
JavaDurationGetSecondsGetNano
: duration.getNano() only accesses the underlying nanosecond adjustment from the whole second.JavaDurationWithNanos
: Use of java.time.Duration.withNanos(int) is not allowed.JavaDurationWithSeconds
: Use of java.time.Duration.withSeconds(long) is not allowed.JavaInstantGetSecondsGetNano
: instant.getNano() only accesses the underlying nanosecond adjustment from the whole second.- 0️⃣
JavaTimeDefaultTimeZone
: java.time APIs that silently use the default system time-zone are not allowed. JodaDurationConstructor
: Use of new Duration(long) is not allowed. Please use Duration.millis(long) instead.JodaDurationWithMillis
: Use of duration.withMillis(long) is not allowed. Please use Duration.millis(long) instead.JodaInstantWithMillis
: Use of instant.withMillis(long) is not allowed. Please use new Instant(long) instead.- 📜
JodaNewPeriod
: This may have surprising semantics, e.g. new Period(LocalDate.parse("1970-01-01"), LocalDate.parse("1970-02-02")).getDays() == 1, not 32. JodaPlusMinusLong
: Use of JodaTime's type.plus(long) or type.minus(long) is not allowed (where = {Duration,Instant,DateTime,DateMidnight}). Please use type.plus(Duration.millis(long)) or type.minus(Duration.millis(long)) instead.JodaTimeConverterManager
: Joda-Time's ConverterManager makes the semantics of DateTime/Instant/etc construction subject to global static state. If you need to define your own converters, use a helper.JodaToSelf
: Use of Joda-Time's DateTime.toDateTime(), Duration.toDuration(), Instant.toInstant(), Interval.toInterval(), and Period.toPeriod() are not allowed.JodaWithDurationAddedLong
: Use of JodaTime's type.withDurationAdded(long, int) (where = {Duration,Instant,DateTime}). Please use type.withDurationAdded(Duration.millis(long), int) instead.TemporalAccessorGetChronoField
: TemporalAccessor.get() only works for certain values of ChronoField.TimeUnitConversionChecker
: This TimeUnit conversion looks buggy: converting from a smaller unit to a larger unit (and passing a constant), converting to/from the same TimeUnit, or converting TimeUnits where the result is statically known to be 0 or 1 are all buggy patterns.- 👻
DurationFrom
: Duration.from(Duration) returns itself; from(Period) throws a runtime exception. DurationGetTemporalUnit
: Duration.get() only works with SECONDS or NANOS.DurationToLongTimeUnit
: Unit mismatch when decomposing a Duration or Instant to call a <long, TimeUnit> API- 👻
InvalidZoneId
: Invalid zone identifier. ZoneId.of(String) will throw exception at runtime. - 👻
PeriodFrom
: Period.from(Period) returns itself; from(Duration) throws a runtime exception. PeriodGetTemporalUnit
: Period.get() only works with YEARS, MONTHS, or DAYS.PeriodTimeMath
: When adding or subtracting from a Period, Duration is incompatible.ProtoDurationGetSecondsGetNano
: getNanos() only accesses the underlying nanosecond-adjustment of the duration.ProtoTimestampGetSecondsGetNano
: getNanos() only accesses the underlying nanosecond-adjustment of the instant.ProtoTruthMixedDescriptors
: The arguments passed toignoringFields
are inconsistent with the proto which is the subject of the assertion.TimeUnitMismatch
: An value that appears to be represented in one unit is used where another appears to be required (e.g., seconds where nanos are needed)
API changes:
- 👍
@BugPattern.category
is no longer supported; prefer@BugPattern.tags
as a means to apply general tags to checks.
Other changes:
- ⚠ Suppress checks thoroughly when
-XepDisableWarningsInGeneratedCode
is passed. - 👉 Make UnusedVariable match unused assignments too.
- 🖐 Handle static methods in InfiniteRecursion
- ➕ Add common java.time types to ReturnValueIgnored.
- 🏗 ModifiedButNotUsed: match orphaned chains of proto/collection builders
- 👌 Improve NarrowingCompoundAssignment's fixes for ternary
- 👍 Allow suppressing AutoValueImmutableFields at the field level rather than just for the entire class.
- 🖐 Handle DateTimeFormat and DateTimeFormatter in MisusedWeekYear
- 👍 Allow suppressing UnusedException on the CatchTree's VariableTree.
- require constructors invoking a
@MustBeClosed
constructor to be marked @MustBeClosed too - 👌 support Android's
@RecentlyXxx
annotations and@CheckForNull
in nullness analysis. - Match methods instead of classes in AutoValueImmutableFields checker.
- ➕ Add a bunch more mutable types to the AutoValueImmutableFields matcher.
- 🛠 Fix bug in WellKnownMutability incorrectly identifying proto1 as proto2.
- Don't flag java.lang.Object in EqualsHashCode check
- 👌 Improve AutoValueFinalMethods check by adding more specific diagnostic at first matched method.
- The NoAllocationChecker now requires the
@NoAllocation
annotation to be propagated to all overrides of a method that has the annotation, to reflect the contractual nature of the annotation. - Catch unescaped entities in Javadocs.
- 🤡
-
v2.3.2 Changes
October 11, 2018Highlights:
- 🚀 Opt-in check AndroidJdkLibsChecker enforces which JDK libraries can be used in Android applications, and, with the
-XepOpt:Android:Java8Libs
flag, can allow select Java 8 library support via https://developer.android.com/studio/write/java8-support. Look out for this in bazel.build after the next release. Immutable{Annotation,Enum}Checker
now requires the Error Prone@Immutable
annotation, not the JSR-305@Immutable
annotation
🆕 New Checks:
- Javadoc Checkers: InvalidParam, InvalidTag, InvalidThrows, ReturnFromVoid
- API Checkers: AndroidJdkLibsChecker, Java7ApiChecker, ApiDiffChecker
- AnnotateFormatMethod
- AnnotationPosition
- ArrayAsKeyOfSetOrMap
- AutoValueFinalMethods
- BadInstanceof
- BigDecimalEquals
- ClassNamedLikeTypeParameter
- CloseableProvides
- ComparingThisWithNull
- 🗄 DeprecatedThreadMethods
- EqualsBrokenForNull
- EqualsGetClass
- EqualsUnsafeCast
- EqualsUsingHashCode
- EqualsWrongThing
- 🔨 ExpectedExceptionRefactoring
- ExtendingJUnitAssert
- FloatingPointAssertionWithinEpsilon
- 🔨 ImmutableRefactoring
- InconsistentHashCode
- InjectOnMemberAndConstructor
- LockNotBeforeTry
- MathAbsoluteRandom
- MathRoundIntLong
- ✅ MissingTestCall
- ModifiedButNotUsed
- NoFunctionalReturnType
- NullableDereference
- ObjectsHashCodePrimitive
- ProtoRedundantSet
- ProtosAsKeyOfSetOrMap
- SubstringOfZero
- SwigMemoryLeak
- SystemExitOutsideMain
- 🔨 TestExceptionRefactoring
- ThreadPriorityCheck
- ToStringReturnsNull
- TruthAssertExpected
- TypeNameShadowing
- UndefinedEquals
- UnnecessaryParentheses
- UnsafeReflectiveConstructionCast
- UnusedException
- VariableNameSameAsType
🛠 Fixes Issues:
#1008, #1028, #1038, #1040, #1077, #1078, #1079, #1083, #1084, #1085, #1095, #1096, #1101, #1125, #1129, #1130, #35, #607, #783, #849, #926
- 🚀 Opt-in check AndroidJdkLibsChecker enforces which JDK libraries can be used in Android applications, and, with the
-
v2.3.1 Changes
April 20, 2018🆕 New checks:
- [AssertThrowsMultipleStatements] The lambda passed to assertThows should contain exactly one statement
- [FieldCanBeFinal] This field is only assigned during initialization; consider making it final
- [ObjectToString] Calling toString on Objects that don't override toString() doesn't provide useful information
Other changes:
- 👉 Make ParcelableCreator check an ERROR
- OrphanedFormatString detects string literals correctly passed to @FormatMethod methods
-
v2.3.0 Changes
April 19, 2018🆕 New checks:
- [ParcelableCreator]: Detects classes which implement Parcelable but don't have CREATOR
- [InconsistentCapitalization] It is confusing to have a field and a parameter under the same scope that differ only in capitalization
- [TruthIncompatibleType] Argument is not compatible with the subject's type
- [ByteBufferBackingArray] ByteBuffer.array() shouldn't be called unless ByteBuffer.arrayOffset() is used or if the ByteBuffer was initialized using ByteBuffer.wrap() or ByteBuffer.allocate()
- [OrphanedFormatString] String literal contains format specifiers, but is not passed to a format method
- [ScopeOnModule] Scopes on modules have no function and will soon be an error
- 🖨 [CatchAndPrintStackTrace] Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace
- [VarTypeName]
var
should not be used as a type name
Other changes:
- ✂ Remove MoreAsserts from TryFailThrowable
- ➕ Add java.util.Arrays to ReturnValueIgnored check
- 👌 Improve BugCheckerRefactoringTestHelper usability
- Extend SizeGreaterThanOrEqualsZero check to check proto repeated fields
- Disallow method references to @DoNotCall methods
- Disallow Error Prone BugPattern names that includes spaces.
- ➕ Add an optional suffix comment to SuggestedFixes.addSuppressWarnings
- 👍 Allow @CompatibleWith to be used on varargs parameters.
- ⚠ Make StreamResourceLeak a warning
- ✅ Recognize null test methods in java.util.Objects in nullness analysis
- Detect more cases of nested and ignored futures.
- ✅ Make the failure message in DiagnosticTestHelper easier to read.
- ⚠ Enable QualifierOrScopeOnInjectMethod as a WARNING
- Consolidate NamedParameters and ParameterName
🛠 Fixes issues: #789, #893, #897, #899, #899, #904, #914, #921, #931, #942, #945, #954, #993
-
v2.2.0 Changes
January 08, 2018🆕 New errors:
- [ComparableType] A new check for detecting incompatibility of types between the type of a class implementing
Comparable<T>
andT
. - [ConditionalExpressionNumericPromotion] A conditional expression with numeric second and third operands of differing types may give surprising results.
🆕 New warnings:
- ✅ [CatchFail] detects tests that ignore exceptions and then call
fail()
- [ModifyCollectionInEnhancedForLoop] detects collections modified within loops.
- [ThreadLocalUsage] ThreadLocals should be stored in static fields.
🆕 New optional checks:
- [StringSplit] detects
String.split(String)
, which has surprising behaviour. - 🔨 [StringSplitter] refactors uses of
String.split
toSplitter
. - 💅 [TypeParameterNaming] enforces that type parameters are named according to the google style guide.
- [RandomCast] casting a random number in the range
[0.0, 1.0)
to an integer or long always results in0
.
🔄 Changes to existing checks
- 👍 ArrayEquals now detects misuse of
android.support.v4.util.ObjectsCompat#equals
. - 👍 EqualsIncompatibleType now detects misuse of
android.support.v4.util.ObjectsCompat#equals
. - SizeGreaterThanOrEqualsZero now detects misuse of common Android-specific collections.
- FilesLinesLeak was renamed to StreamResourceLeak, and now checks other methods in Files.
- 👕 FunctionalInterfaceClash is no longer enabled by default.
- JUnit4{SetUp,TearDown}NotRun will find methods that look like setup or teardown methods, but have a
@Before
or@After
annotation that are notorg.junit.Before
ororg.junit.After
. - SimpleDateFormatConstant now handles all
DateFormats
, and is renamed to DateFormatConstant - 0️⃣ Disable RestrictToEnforcer by default (fixes #812).
- EqualsIncompatibleType/PredicateIncompatibleType/CollectionIncompatible now explore type parameters to ensure their compatibility:
Foo<A>
is incompatible withFoo<B>
ifA
andB
are incompatible with each-other.
Other changes
- [ComparableType] A new check for detecting incompatibility of types between the type of a class implementing
-
v2.1.3
November 28, 2017 -
v2.1.2
October 19, 2017 -
v2.1.1
August 28, 2017