On Tue, 22 Nov 2022 17:05:52 GMT, Xue-Lei Andrew Fan <xue...@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`.
>
> src/java.base/share/classes/javax/security/auth/Subject.java line 329:
> 
>> 327:      * subject is {@code null} before the first call of {@code 
>> callAs()}.
>> 328:      * <p>
>> 329:      * When a new thread is created, its current subject is the same as
> 
> what about change from"when" to "if", in case some implementation still 
> create a new thread?

This is not about the implementation of this method, which might or might not 
allow the current subject to be inherited in a new thread. The spec change is 
telling the users of this method that such inheritance is no longer guaranteed. 
We are still not sure if the future implementation of this method can guarantee 
that, but given it's already broken now, we'd better remove this requirement. 
We can add if later if we can do that.

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

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

Reply via email to