RFR: 8297276: Remove thread text from Subject.current

Alan Bateman alanb at openjdk.org
Wed Nov 23 12:37:18 UTC 2022


On Tue, 22 Nov 2022 16:26:30 GMT, Weijun Wang <weijun at openjdk.org> wrote:

> With the introduction of Virtual Threads, the current subject is no longer guaranteed to be inherited in a new thread. Remove this requirement until we find another way to implement `Subject::current`.

Just re-reading the javadoc for Subject.callAs. It doesn't say anything about inheritance so there shouldn't be any expectation that Subject is inherited, so I think the change proposed here is okay. For another PR but I think the callAs javadoc could say a bit more about the Subject being set for the bounded execution of the given task. When the task completes, the current Subject is null or reverts to its previous value in the current thread.

-------------

PR: https://git.openjdk.org/jdk/pull/11292



More information about the security-dev mailing list