merlimat opened a new pull request, #25429:
URL: https://github.com/apache/pulsar/pull/25429
## Motivation
Fix `try` compiler warnings in test code — auto-closeable resources that are
not properly handled in try-with-resources statements.
This is part of a series to clean up test compile warnings (following
production code cleanup in #25414-#25422).
## Changes
- **Category 1**: Resources whose `close()` throws `InterruptedException` —
cannot be used in try-with-resources without catching checked exception; add
`@SuppressWarnings("try")` at method level
- **Category 2**: Auto-closeable resources assigned but never referenced —
rename to `ignored` or suppress with `@SuppressWarnings("try")`
Affected modules: `pulsar-broker`, `pulsar-broker-common`, `pulsar-common`,
`pulsar-client`, `pulsar-functions`, `managed-ledger`, and others (~28 files).
## Verifying this change
- `./gradlew compileTestJava` passes cleanly
- `try` 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]