Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIn Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing the loop on this: after digging into the However, as @msridhar noted, testing against the current |
Description
This PR addresses Issue #1002 by fixing false positive warnings that occur when passing
@Nullablearguments to varargs methods (like Caffeine'srequireState) in JSpecify mode.Root Cause & Fix
When JSpecify mode is enabled, NullAway correctly parses a varargs parameter like
@Nullable Object... argsas an array with nullable elements, rather than a nullable array itself.However, during
handleInvocation, NullAway was still usingNullness.paramHasNullableAnnotation(...)to check the varargs parameter. Because that method checks the top-level array type, it failed to see the@Nullableelement annotation, resulting in NullAway strictly enforcing@NonNullarguments for the varargs positions.I updated the logic inside
NullAway.java'shandleInvocationmethod. When JSpecify mode is active and the parameter being evaluated is the final varargs parameter, it now explicitly delegates toNullabilityUtil.nullableVarargsElementsForSourceOrBytecode(param, config)to check the element's nullability. Legacy behavior is preserved when JSpecify mode is off.The test suite is fully green.
Summary by CodeRabbit