Error Prone 2.1.0 release

100 views
Skip to first unread message

Liam Miller-Cushon

unread,
Aug 21, 2017, 7:19:32 PM8/21/17
to error-pro...@googlegroups.com

Error Prone 2.1.0 is now available for download from Maven Central.


New error checks:


* [EqualsReference] Detects infinite recursion in equals() methods.

* [ComplexBooleanConstant] Discourage trivial compile-time constant booleans (e.g. `1 < 2`).

* [NullTernary] Detects nullable ternary expressions that may cause NPEs.


New warning checks:


* [CollectionToArraySafeParameter] Check to make sure that array types and collection types are not disjoint in Collection.toArray methods.

* [JUnit4ClassUsedInJUnit3] Check for Assume in a JUnit3 tests.

* [IntLongMath] Check for int math that may overflow before being assigned to a long.

* [MultipleParallelOrSequentialCalls] Check to make sure that people are not calling .parallel() or .sequential() more than once in a stream.

* [IncrementInForLoopAndHeader] Detect increments in both loop headers and bodies.

* [OverrideThrowableToString] Warns against overriding toString() in a class that extends Throwable and suggests getMessage() instead.
* [ThreadJoinLoop] Thread.join() should be replaced by Uninterruptibles.join(), which makes sure that Thread.join() is attempted until it succeeds.
* [AssertionFailureIgnored] New check to prevent calls to assert methods that throw AssertionError inside try blocks that catch AssertionError.
* [CollectorShouldNotUseState] Detect when Collector.of() uses state.

* [OptionalNotPresent] Check for calling optional.get() inside an if statement that checks for !optional.isPresent().

New experimental checks


* [FuzzyEqualsShouldNotBeUsedInEqualsMethod] Detect when DoubleMath.fuzzyEquals is used in an Object.equals() method.

* [MutableMethodReturnType] Method return type should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List).

* [MultipleUnaryOperatorsInMethodCall] Warn against having multiple unary operators in one method call.

Other changes


* Refaster compiler accepts multiple rules nested in the same file.
* Demote Overrides checker to warning.
* For CheckReturnValue, etc., return values can be ignored at the end of a ThrowingRunnable body regardless of whether it was passed directly to assertThrows.
* JUnit4 BugCheckers now recognize and check any class with a JUnit @Test annotation on any method, not just classes annotated @RunWith.
* Whitelist JDK 9 additions to CompletableFuture in FutureReturnValueIgnored.
* MissingDefault: don't crash on statement groups with multiple statements (#684).
* Refactor OvershadowingSubclassFields so you can now suppress the check on individual fields (#668).
* Make additional Nullable bugpatterns available (#472).
* InvalidPathException due to colon using the XepPatchLocation option on Windows (#514).
* Fix a null pointer exception in AbstractReturnValueIgnored on expression-type lambdas (#657).

* Update to latest Checker Framework dataflow version (#696).


Reply all
Reply to author
Forward
0 new messages