Error Prone v2.50.0 Release Notes
Release Date: 2026-06-10 // 1 day ago-
🆕 New checks:
BoxingComparator: Detect implicitly-boxing Comparator.comparing key extractorsExposedPrivateType: Discourage references to private member classes from non-private APIs- ✅
JUnitMethodInvoked: Discourage directly invoking JUnit test methods - 🚚
ListRemoveAmbiguous: Detect ambiguous calls toList.remove(int|Integer) - ✅
PreferTestParameter: suggests using@TestParameterinstead of@TestParametersfor exhaustive boolean and enum parameters on single-element parameterized tests RecordComponentAccessorAnnotationConflict: Detect conflicts between record components and explicit accessor methodsRecordComponentOverride: Discourage @OverRide on record component declarations that don't override
anythingThrowableEqualsHashCode: Discourage overridingThrowable.equals()andhashCode()
Closed issues: #5553, #5649, #5778
Full changelog: v2.49.0...v2.50.0
Previous changes from v2.49.0
-
🚀 This release includes several changes to
MatcherAPIs, and removed some deprecated or problematic APIs:- ✂ Remove deprecated
MethodMatchers.withSignatureAPI, which relies on fragiletoStringbehaviour. Alternatives for matching on method signatures with varargs and type parameters were added in a98a1c5. - ✂ Removed
variableType(Matcher)API.Matchers.variableType(Matcher)usesVariableTree#getTypeto match variable types, which own't work for lambda parameters with inferred types after JDK-8268850. The recommended replacement isvariableType(TypePredicate). - 📦 Make
enclosingPackagereturn an optional. Module elements are not enclosed by a package, checks usingenclosingPackageshouldn't assume an enclosing package exists when processing arbitrary elements. - 🆕 New
FieldMatchersAPI, similar toMethodMatchers(1dd9c3a).
🆕 New checks:
AssertThrowsBlockToExpression: Discourage unnecessary block lambdas inassertThrows.AssertThrowsMinimizer: Suggest minimizing the amount of logic inassertThrows.MemorySegmentReferenceEquality: Discourage using reference equality forMemorySegments.- 👻
PreferThrowsTag: Recommends using@throwsinstead of the legacy@exceptionjavadoc tag. RecordAccessorInCompactConstructor: detect record accessors inside the compact canonical ctors, which read uninitialized fields.
Closed issues: #2283, #3503, #5210, #5289, #5548, #5548, #5554, #5609, #5614, #5656
Full changelog: v2.48.0...v2.49.0
- ✂ Remove deprecated