merlimat opened a new pull request, #25431:
URL: https://github.com/apache/pulsar/pull/25431
## Motivation
Fix `unchecked` compiler warnings in test code — unchecked casts and generic
array creation due to type erasure.
This is part of a series to clean up test compile warnings (following
production code cleanup in #25414-#25422).
## Changes
- Add `@SuppressWarnings("unchecked")` at method or variable level for
unavoidable Mockito mock casts (type erasure prevents parameterized mock casts
at runtime)
- Use `doReturn().when()` instead of `when().thenReturn()` where wildcard
capture causes unchecked warnings
- Add `@SafeVarargs` for varargs utility methods that only read from the
array
- Fix generic array creation warnings in test utility methods
Affects ~213 files across all modules.
## Verifying this change
- `./gradlew compileTestJava` passes cleanly
- `unchecked` warning count drops to zero
### Does this pull request potentially affect one of the following areas?
- [x] *Test code only*
### Documentation
- [x] `doc-not-needed` — test-only changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]