yandrey321 opened a new pull request, #11363:
URL: https://github.com/apache/ozone/pull/11363
## What changes were proposed in this pull request?
`TestOmMixedWorkloadUnderDeletionBench` loads async-profiler reflectively so
the benchmark
carries no compile-time or Maven dependency on it. That loader wrapped its
four reflective
calls in `AccessController.doPrivileged`, which the build reports as:
[WARNING] .../TestOmMixedWorkloadUnderDeletionBench.java:[673,16]
java.security.AccessController
in java.security has been deprecated and marked for
removal`java.security.AccessController` is `@Deprecated(since="17",
forRemoval=true)` under JEP 411.
This PR removes the wrapper and the three `java.security` imports, calling
the loader body
directly. The removal is behaviour-preserving rather than a warning
suppression:
* `doPrivileged` is inert without a `SecurityManager`, and
`System.setSecurityManager` throws
by default on JDK 17+, so there is no protection domain to elevate. The
block was already
a no-op in every supported runtime.
* The `PrivilegedActionException` catch existed only to undo the
checked-exception boxing that
`PrivilegedExceptionAction` imposes. The enclosing `load()` already
declares
`throws Exception`, so `toURI().toURL()`, `Class.forName`, `getMethod` and
`invoke` now
propagate their checked exceptions directly — same types, same call sites,
one less unwrap.
This is the only occurrence in the repository: `doPrivileged` has a single
hit across all
`*.java` sources, and `java.security.AccessController` a single import. (The
unrelated
`MultiTenantAccessController` family is a different type and is untouched.)
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16645
## How was this patch tested?
he change is test-only and touches the profiler loader, so it was verified
by compiling the
warning away and then by actually running the profiler through the modified
path.
**1. The warning is gone (before/after on the same tree, JDK 17):**
`mvn -pl :ozone-integration-test test-compile`
| | result |
|---|---|
| before | `TestOmMixedWorkloadUnderDeletionBench.java:[673,16] ...
deprecated and marked for removal` |
| after | no deprecation/removal warnings; BUILD SUCCESS |
Validated that test still works with async profiler.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]