On Tue, 11 Jun 2024 20:31:03 GMT, Sean Mullan <[email protected]> wrote:
>> src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java
>> line 350:
>>
>>> 348: @SuppressWarnings("removal")
>>> 349: private Subject getSubject() {
>>> 350: Subject subject = null;
>>
>> Just call `Subject.current()`. When SM is allowed, it is equivalent to
>> `getSubject(AccessController.getContext())`.
>
> For the same reason you should be able to just call `Subject.current` in the
> tests. I don't think you need the `SimpleStandard.useGetSubjectACC` property
> to toggle the testing of either old or replacement APIs as long as the test
> has runs in both SM allow and disallow (i.e., no SM prop set) modes. Would
> you agree Weijun?
I thought there was a comment elsewhere suggesting using SM=allow to test with
Subject.getSubject() and Subject.current(), and when SM not allowed, to only
use Subject.current() ?
That was the reason for the property in the tests.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19624#discussion_r1636536113