Skip to content

Error Prone 2.53.0

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Nov 11:02

New checks:

  • BootclasspathShadowing: Flag top-level class declarations whose binary name shadows a platform or bootclasspath type (disabled by default).
  • DiscouragedHashKey: Configurable check for hash-based containers keyed on types (or their subtypes) specified via -XepOpt:DiscouragedHashKey:Types (no-op unless configured).

Other changes:

  • EqualsHashCode: Flag classes that override hashCode without overriding equals, gated by -XepOpt:EqualsHashCode:CheckHashCodeWithoutEquals (enabled by default) (#129).
  • MustBeClosedChecker: Enforce @MustBeClosed on method and constructor references.
  • URLEqualsHashCode: Rebuild on the shared equality and hash-key analysis engine to also check Multimap, Multiset, Stream.collect, direct equality, assertions, and containment, while ignoring identity and sorted containers.
  • ImpossibleNullComparison: Flag impossible null comparisons via Objects.equals, Objects.isNull, and Objects.nonNull.
  • TruthIncompatibleType: Check Guava Table assertions.
  • PatternMatchingInstanceof: Suggest instanceof Foo<?> foo for raw instanceof Foo checks.
  • CompileTimeConstant: Recognize Guava ImmutableMap.of, ImmutableMultiset.of, ImmutableSortedSet.of, and ImmutableSortedMap.of, as well as JDK List.of, Set.of, and Map.of.
  • Immutable: Add Gson and Guava TypeToken to WellKnownMutability, and stop caching negative symbol and type lookups across a compilation unit so lazily completed supertypes are resolved reliably.
  • PreconditionsCheckNotNullRepeated: Also check Guava's Verify.verifyNotNull.
  • LambdaFunctionalInterface: Only match Integer, Long, and Double type arguments instead of all Number subtypes.
  • EqualsIncompatibleType / TypeCompatibility: Avoid false positives with incomplete classpaths.
  • LoopConditionChecker / TimeUnitConversionChecker / InlineTrivialConstant / NonAtomicVolatileUpdate: Recognize compile-time constants in loop conditions (#5826) and TimeUnit conversions (#6279), and unwrap parenthesized expressions in InlineTrivialConstant (#6217) and NonAtomicVolatileUpdate (#6214).
  • StatementSwitchToExpressionSwitch / IfChainToSwitch: Fix dead-code deletion after return switch and consolidate reachability handling.
  • Performance: Evaluate MethodMatchers constraints in selectivity order, optimize SuppressionInfo, and reduce per-call overhead across CheckReturnValue, DoNotCall, ParameterName, UnusedMethod, AlmostJavadoc, and several other checks.
  • Check API: Validate package names with SourceVersion.isName in Matchers.packageStartsWith, and document that ASTHelpers.getSymbol(Tree) returns null for parenthesized expressions (#6223).

Closed issues: #5826, #6214, #6217, #6223, #6279

Full changelog: v2.52.0...v2.53.0