Repository navigation
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 overridehashCodewithout overridingequals, gated by-XepOpt:EqualsHashCode:CheckHashCodeWithoutEquals(enabled by default) (#129).MustBeClosedChecker: Enforce@MustBeClosedon method and constructor references.URLEqualsHashCode: Rebuild on the shared equality and hash-key analysis engine to also checkMultimap,Multiset,Stream.collect, direct equality, assertions, and containment, while ignoring identity and sorted containers.ImpossibleNullComparison: Flag impossible null comparisons viaObjects.equals,Objects.isNull, andObjects.nonNull.TruthIncompatibleType: Check GuavaTableassertions.PatternMatchingInstanceof: Suggestinstanceof Foo<?> foofor rawinstanceof Foochecks.CompileTimeConstant: Recognize GuavaImmutableMap.of,ImmutableMultiset.of,ImmutableSortedSet.of, andImmutableSortedMap.of, as well as JDKList.of,Set.of, andMap.of.Immutable: Add Gson and GuavaTypeTokentoWellKnownMutability, and stop caching negative symbol and type lookups across a compilation unit so lazily completed supertypes are resolved reliably.PreconditionsCheckNotNullRepeated: Also check Guava'sVerify.verifyNotNull.LambdaFunctionalInterface: Only matchInteger,Long, andDoubletype arguments instead of allNumbersubtypes.EqualsIncompatibleType/TypeCompatibility: Avoid false positives with incomplete classpaths.LoopConditionChecker/TimeUnitConversionChecker/InlineTrivialConstant/NonAtomicVolatileUpdate: Recognize compile-time constants in loop conditions (#5826) andTimeUnitconversions (#6279), and unwrap parenthesized expressions inInlineTrivialConstant(#6217) andNonAtomicVolatileUpdate(#6214).StatementSwitchToExpressionSwitch/IfChainToSwitch: Fix dead-code deletion afterreturn switchand consolidate reachability handling.- Performance: Evaluate
MethodMatchersconstraints in selectivity order, optimizeSuppressionInfo, and reduce per-call overhead acrossCheckReturnValue,DoNotCall,ParameterName,UnusedMethod,AlmostJavadoc, and several other checks. - Check API: Validate package names with
SourceVersion.isNameinMatchers.packageStartsWith, and document thatASTHelpers.getSymbol(Tree)returnsnullfor parenthesized expressions (#6223).
Closed issues: #5826, #6214, #6217, #6223, #6279
Full changelog: v2.52.0...v2.53.0