You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/03/29 03:31:45 UTC
[PR] [improve][test] Fix try-with-resources compile warnings in test code [pulsar]
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][test] Fix try-with-resources compile warnings in test code [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on PR #25429:
URL: https://github.com/apache/pulsar/pull/25429#issuecomment-4149342746
/pulsarbot rerun-failure-checks
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][test] Fix try-with-resources compile warnings in test code [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #25429:
URL: https://github.com/apache/pulsar/pull/25429
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org