Skip to content

Error Prone 2.2.0

Compare
Choose a tag to compare
@cushon cushon released this 08 Jan 23:44
· 3509 commits to master since this release

New errors:

  • [ComparableType] A new check for detecting incompatibility of types between the type of a class implementing Comparable<T> and T.
  • [ConditionalExpressionNumericPromotion] A conditional expression with numeric second and third operands of differing types may give surprising results.

New warnings:

New optional checks:

  • [StringSplit] detects String.split(String), which has surprising behaviour.
  • [StringSplitter] refactors uses of String.split to Splitter.
  • [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 in 0.

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 not org.junit.Before or org.junit.After.
  • SimpleDateFormatConstant now handles all DateFormats, and is renamed to DateFormatConstant
  • Disable RestrictToEnforcer by default (fixes #812).
  • EqualsIncompatibleType/PredicateIncompatibleType/CollectionIncompatible now explore type parameters to ensure their compatibility: Foo<A> is incompatible with Foo<B> if A and B are incompatible with each-other.

Other changes

  • Update to javac 9+181-r4173-1 (fixes #781 and #784).
  • Remove BugPattern.suppressibility and BugPattern.customSuppressionAnnotations: suppressionAnnotations should be used instead.