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

2024-10-15 Thread David Holmes
On Wed, 9 Oct 2024 11:24:43 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base

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

2024-10-14 Thread Alan Bateman
On Wed, 9 Oct 2024 11:24:43 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base

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

2024-10-14 Thread Maurizio Cimadamore
On Wed, 9 Oct 2024 11:24:43 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base

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

2024-10-09 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-10-07 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-10-07 Thread Maurizio Cimadamore
On Tue, 24 Sep 2024 14:56:19 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-10-07 Thread Hannes Wallnöfer
On Tue, 24 Sep 2024 14:56:19 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-10-04 Thread Mandy Chung
On Wed, 2 Oct 2024 05:15:04 GMT, David Holmes wrote: > 3. I will just note that the description for this issue is "Clarify handling > of restricted and caller-sensitive methods" but there is nothing in the > proposed changes that relate to CS methods, and I think we have agreed that > any doc

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

2024-10-04 Thread Hannes Wallnöfer
On Tue, 24 Sep 2024 14:56:19 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-10-04 Thread Hannes Wallnöfer
On Fri, 4 Oct 2024 16:32:50 GMT, Pavel Rappo wrote: >> test/langtools/jdk/javadoc/doclet/testRestricted/TestRestricted.java line 45: >> >>> 43: public static void main(String... args) throws Exception { >>> 44: var tester = new TestRestricted(); >>> 45: tester.setAutomaticChe

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

2024-10-04 Thread Maurizio Cimadamore
On Fri, 4 Oct 2024 16:32:50 GMT, Pavel Rappo wrote: > It will only be `@docRoot` in the JDK, but not in any other code base, and > certainly not in that test. Note: only JDK is allowed to have restricted methods. `@Restricted` is a non-exported JDK annotation. So 3rd party libraries cannot def

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

2024-10-04 Thread Pavel Rappo
On Mon, 23 Sep 2024 21:03:08 GMT, Maurizio Cimadamore wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix javadoc test failure > > test/langtools/jdk/javadoc/doclet/testRestricted/TestRestricted.java line 4

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

2024-10-01 Thread David Holmes
On Tue, 24 Sep 2024 14:56:19 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-10-01 Thread David Holmes
On Mon, 23 Sep 2024 12:06:51 GMT, Jorn Vernee wrote: >>> 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 thou

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

2024-10-01 Thread David Holmes
On Tue, 24 Sep 2024 14:56:19 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-10-01 Thread David Holmes
On Mon, 23 Sep 2024 21:06:12 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-10-01 Thread David Holmes
On Tue, 24 Sep 2024 14:48:50 GMT, Jorn Vernee wrote: >> The "stack" is exposed in the API with StackWalker, Thread::getStackTrace >> and other APIs. For CS and restricted methods then I think we are trying to >> convey that there are no Java frames on the caller stack. Several existing >> CS A

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

2024-09-24 Thread Jorn Vernee
On Tue, 24 Sep 2024 06:51:49 GMT, Alan Bateman wrote: > For now, I think the proposed wording in this PR is okay. Yes, I agree what I'm suggesting is out of scope for this PR. - PR Review Comment: https://git.openjdk.org/jdk/pull/21067#discussion_r1773524153

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

2024-09-24 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-09-24 Thread Jorn Vernee
On Tue, 24 Sep 2024 14:53:22 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-24 Thread Alan Bateman
On Mon, 23 Sep 2024 21:06:12 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-23 Thread Alan Bateman
On Tue, 24 Sep 2024 06:19:12 GMT, David Holmes wrote: > > It is outside the scope of the javadoc text to state exactly why each > > restricted method is marked as such. > > I don't agree. I think restricted methods should document why they are > restricted if it is not patently obvious. I thi

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

2024-09-23 Thread Alan Bateman
On Mon, 23 Sep 2024 12:06:51 GMT, Jorn Vernee wrote: >>> 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 thou

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

2024-09-23 Thread David Holmes
On Mon, 23 Sep 2024 10:35:44 GMT, Maurizio Cimadamore wrote: > It is outside the scope of the javadoc text to state exactly why each > restricted method is marked as such. I don't agree. I think restricted methods should document why they are restricted if it is not patently obvious. --

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

2024-09-23 Thread Maurizio Cimadamore
On Mon, 23 Sep 2024 21:03:08 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-23 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-09-23 Thread Jorn Vernee
On Mon, 23 Sep 2024 11:45:23 GMT, Jorn Vernee wrote: >> 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 n

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

2024-09-23 Thread Jorn Vernee
On Mon, 23 Sep 2024 09:39:00 GMT, David Holmes 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.

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

2024-09-23 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-09-23 Thread Maurizio Cimadamore
On Mon, 23 Sep 2024 10:30:18 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-23 Thread David Holmes
On Mon, 23 Sep 2024 08:42:43 GMT, Alan Bateman wrote: > Is your ask that the javadoc generated text inline this, or the equivalent by > change the method description of each restricted method? I admit I had missed the fact there would be some auto-generated text and links in the API docs for

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

2024-09-23 Thread David Holmes
On Mon, 23 Sep 2024 09:33:27 GMT, Alan Bateman wrote: >> I suggested the current wording here: >> https://github.com/openjdk/jdk/pull/21067#discussion_r1767316787 >> >> I think 'no caller on the stack' is too vague. AFAICT, the mechanism by >> which a CS method determines its caller is not doc

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

2024-09-23 Thread Alan Bateman
On Mon, 23 Sep 2024 09:21:35 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/doc-files/RestrictedMethods.html line >> 43: >> >>> 41: When a restricted method is invoked by >> href="../../../../specs/jni/index.html">JNI code, >>> 42: or from an >> href="../Linker.html#upcall

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

2024-09-23 Thread Jorn Vernee
On Mon, 23 Sep 2024 08:22:52 GMT, Alan Bateman wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update >> src/java.base/share/classes/java/lang/doc-files/RestrictedMethods.html >> >> Co-authored-by: Jor

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

2024-09-23 Thread Alan Bateman
On Thu, 19 Sep 2024 12:29:34 GMT, Maurizio Cimadamore wrote: > As I wrote in the CSR request for the JEP: > > > I think each method that is restricted and/or caller-sensitive should > > specify what happens when called when there is no caller context. We should > > use `AccessibleObject::canA

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

2024-09-23 Thread Alan Bateman
On Thu, 19 Sep 2024 21:25:21 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-23 Thread Alan Bateman
On Thu, 19 Sep 2024 14:08:37 GMT, Maurizio Cimadamore wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Move restricted method page to `java.lang` >> Update restricted method page > > src/java.base/share/cl

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

2024-09-22 Thread David Holmes
On Fri, 20 Sep 2024 08:48:50 GMT, Maurizio Cimadamore wrote: > Just be clarify: is it your expectation that, in order for this issue to be > fixed, we should fix the javadoc of all caller sensitive methods, addressing > issues that have nothing to do with restricted-ness? No, just the new res

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

2024-09-20 Thread Maurizio Cimadamore
On Thu, 19 Sep 2024 21:25:21 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-19 Thread David Holmes
On Thu, 19 Sep 2024 12:29:34 GMT, Maurizio Cimadamore wrote: > And I claim that this is outside the scope of this PR. And I strongly disagree because the only reason I conceded that this documentation issue need not be addressed by the CSR request for JEP 472 was because JDK-8338596 was filed

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

2024-09-19 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-09-19 Thread Maurizio Cimadamore
On Thu, 19 Sep 2024 17:21:30 GMT, Jorn Vernee wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Move restricted method page to `java.lang` >> Update restricted method page > > src/java.base/share/classes/jav

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

2024-09-19 Thread Jorn Vernee
On Thu, 19 Sep 2024 13:59:30 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-19 Thread Maurizio Cimadamore
On Thu, 19 Sep 2024 13:59:30 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

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

2024-09-19 Thread Maurizio Cimadamore
> This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). > > This is

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

2024-09-19 Thread Maurizio Cimadamore
On Thu, 19 Sep 2024 13:59:30 GMT, Maurizio Cimadamore wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.bas

Re: RFR: 8338596: Clarify handling of restricted and caller-sensitive methods

2024-09-19 Thread Maurizio Cimadamore
On Thu, 19 Sep 2024 02:59:39 GMT, David Holmes wrote: > As I wrote in the CSR request for the JEP: > > > I think each method that is restricted and/or caller-sensitive should > > specify what happens when called when there is no caller context. We should > > use `AccessibleObject::canAccess` a

Re: RFR: 8338596: Clarify handling of restricted and caller-sensitive methods

2024-09-18 Thread David Holmes
On Wed, 18 Sep 2024 18:03:47 GMT, Jorn Vernee wrote: >> This PR moves the section on restricted methods from the the javadoc of >> `java.lang.foreign` package into a standalone static [javadoc >> page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/la

Re: RFR: 8338596: Clarify handling of restricted and caller-sensitive methods

2024-09-18 Thread David Holmes
On Wed, 18 Sep 2024 15:47:01 GMT, Maurizio Cimadamore wrote: > This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/j

Re: RFR: 8338596: Clarify handling of restricted and caller-sensitive methods

2024-09-18 Thread David Holmes
On Wed, 18 Sep 2024 18:07:52 GMT, Jorn Vernee wrote: > Is the java/lang/foreign package still the right place for this? (Maybe it > should be under java/lang). I agree, the scope for this is now outside the foreign package. - PR Comment: https://git.openjdk.org/jdk/pull/21067#issu

Re: RFR: 8338596: Clarify handling of restricted and caller-sensitive methods

2024-09-18 Thread Jorn Vernee
On Wed, 18 Sep 2024 15:47:01 GMT, Maurizio Cimadamore wrote: > This PR moves the section on restricted methods from the the javadoc of > `java.lang.foreign` package into a standalone static [javadoc > page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/j

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

2024-09-18 Thread Maurizio Cimadamore
This PR moves the section on restricted methods from the the javadoc of `java.lang.foreign` package into a standalone static [javadoc page](https://cr.openjdk.org/~mcimadamore/jdk/restricted_javadoc_section/docs/api/java.base/java/lang/foreign/doc-files/RestrictedMethods.html). This is because,