Error Prone 2.0.10 release

58 views
Skip to first unread message

Ian Rogers

unread,
Jul 15, 2016, 6:59:26 PM7/15/16
to error-pron...@googlegroups.com

We are pleased to announce the release of Error Prone 2.0.10.


Error Prone now supports custom checks via a plugin mechanism. Documentation is available at http://errorprone.info/docs/plugins.


New checks:

- [BigDecimalLiteralDouble] Discourage `new BigDecimal(double)` and `BigDecimal.valueOf(double)`

- [BoxedPrimitiveConstructor] Discourage constructors of primitive wrapper objects

- [ClassNewInstance] Replace `Class#newInstance()` with `getConstructor().newInstance()`

- [ConstantField] CONSTANT_CASE fields that are not static and final

- [DaggerProvidesNull] Dagger @Provides methods may not return null unless annotated with @Nullable

- [DefaultCharset] discourage implicit use of the default Charset

- [FormatString] validate format strings

- [GetClassOnAnnotation] check for `getClass()` on annotations

- [GetClassOnEnum] check for `getClass()` on enums

- [HardCodedSdCardPath] Android check for hard-coded references to "/sdcard"

- [JUnit3FloatingPointComparisonWithoutDelta] check for floating-point assertEquals() calls without an error tolerance in JUnit 3

- [PrivateConstructorForNoninstantiableModuleTest] Add a check that suggests adding a private constructor to classes with only static members

- [RandomModInteger] `Random.nextInt() % n` can have negative results, use `Random.nextInt(int)` instead

- [RemoveUnusedImports] Detects unused imports

- [StreamToString] disallow explicit and implicit calls to Stream.toString

- [UseBinds] Add a check for Dagger 2 that suggests using @Binds over @Provides or @Produces.


Other changes:

- Error Prone now supports Android's @SuppressLint.

- Make GetClassOnAnnotation an error

- Fixed DaggerProvidesNull bug in Java 8 code

- Detect implicit conversions to String in ArrayToString

- Catch no-op calls to Throwables.propagateIfPossible(e)

- Move bug patterns related to dependency injection into an "inject" subpackage.

- Changes to Refaster return type handling behavior


Fixes issues: #407
Reply all
Reply to author
Forward
0 new messages