RFR: 8338596: Clarify handling of restricted and caller-sensitive methods [v3]

Jorn Vernee jvernee at openjdk.org
Mon Sep 23 11:47:45 UTC 2024


On Mon, 23 Sep 2024 09:39:00 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> We use "no caller class" in the CS methods, maybe it could be improved. 
>> 
>> I think "can not be determined" just begs questions. Is this a JDK limitation, something I'm doing wrong, or something else, ... if you see what I mean.
>
> It is documented by the CS JEP: https://openjdk.org/jeps/176
> 
>> It discovers its caller's class by invoking the sun.reflect.Reflection.getCallerClass method.
> 
> CS set the precedent here and the terminology.

> I think "can not be determined" just begs questions. Is this a JDK limitation, something I'm doing wrong, or something else, ... if you see what I mean.

I think saying 'no caller class on the stack' has the same effect though, unless someone knows how the implementation works (which may not be unreasonable), and is aware of the scenario where a java method is called from a new native thread. I thought it would look cleaner to have this be more 'explicitly unspecified' instead. But, maybe having something (vague or not), is better than nothing...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21067#discussion_r1771253876


More information about the core-libs-dev mailing list