Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-23 Thread Rony G. Flatscher
Hi Peter, firstly: thank you *very* much again for your kind hints and help! Ad Rexx and Java: the aim is to have Rexx (dynamically typed, caseless) behave 1:1 like a compilable and runnable Java program. Over the course of time I looked into ASM (many, many years ago) to add the ability to

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Peter Levart
Hi Rony, On 01/22/18 16:35, Rony G. Flatscher wrote: Hi Peter, thank you *very* much also for your kind explanations and even coming up with agent code to demonstrate how one could use that approach! In fact I have been doing a static analysis in the past (since Java 1.1) to determine

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Rony G. Flatscher
Hi, On 22.01.2018 16:24, Roger Riggs wrote: > Contributions need to be submitted using the OpenJDK infrastructure to adhere > to the IP requirements. Would you have a link which OpenJFDK infrastructure to use in this case? > The mail lists shold pass attachments that are text and patches though

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Rony G. Flatscher
On 22.01.2018 12:18, Alan Bateman wrote: > On 22/01/2018 09:58, Peter Levart wrote: >> : >> >> The 2nd problem is not trivial as you want to access a protected member on >> behalf of some other >> sub-class of the member's declaring class which is not cooperating >> (voluntarily handing you an

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Rony G. Flatscher
Hi Peter, thank you *very* much also for your kind explanations and even coming up with agent code to demonstrate how one could use that approach! In fact I have been doing a static analysis in the past (since Java 1.1) to determine whether members should be accessible to Rexx, restricting

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Roger Riggs
Hi, Contributions need to be submitted using the OpenJDK infrastructure to adhere to the IP requirements. The mail lists shold pass attachments that are text and patches though you may need to be sure your mailer attaches them with the correct mime-types and/or extensions. Roger p.s. The

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Rony G. Flatscher
On 19.01.2018 15:38, Alan Bateman wrote: > On 18/01/2018 15:07, Rony G. Flatscher wrote: >> An attachment in the email has been found to contain executable code and has >> been removed. >> >> File removed : java9modules.zip, zip,cmd >>

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Peter Levart
@Potential implementer of below trick BEWARE! While I tried to be smart by "injecting" special java agent powers into designated trusted class, the presented mechanism is NOT SAFE as I identify the class only by it's name. An attacker might create it's own pair of classes with same names

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Peter Levart
On 01/22/2018 12:18 PM, Alan Bateman wrote: On 22/01/2018 09:58, Peter Levart wrote: : The 2nd problem is not trivial as you want to access a protected member on behalf of some other sub-class of the member's declaring class which is not cooperating (voluntarily handing you an instance of

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Peter Levart
Hi Rony, On 01/22/2018 10:58 AM, Peter Levart wrote: The 2nd problem is not trivial as you want to access a protected member on behalf of some other sub-class of the member's declaring class which is not cooperating (voluntarily handing you an instance of its Lookup object). This currently

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Alan Bateman
On 22/01/2018 09:58, Peter Levart wrote: : The 2nd problem is not trivial as you want to access a protected member on behalf of some other sub-class of the member's declaring class which is not cooperating (voluntarily handing you an instance of its Lookup object). This currently requires

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Peter Levart
Hi Rony, On 01/18/2018 04:11 PM, Rony G. Flatscher wrote: On 18.01.2018 10:58, Alan Bateman wrote: On 17/01/2018 18:53, Rony G. Flatscher wrote: : Would you have concrete suggestions for this use-case, i.e. a framework that is not part of a module, but having a need to access public types

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-19 Thread Alan Bateman
On 18/01/2018 15:07, Rony G. Flatscher wrote: An attachment in the email has been found to contain executable code and has been removed. File removed : java9modules.zip, zip,cmd Dear Alan: tried to come up with a

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-18 Thread Rony G. Flatscher
On 18.01.2018 10:58, Alan Bateman wrote: > On 17/01/2018 18:53, Rony G. Flatscher wrote: >> >> : >> >> Would you have concrete suggestions for this use-case, i.e. a framework that >> is not part of a >> module, but having a need to access public types from exported packages and >> get

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-18 Thread Rony G. Flatscher
Dear Alan: tried to come up with a "cleaner" version to zip it up, however the error would not occur there. --- As I have to get off for today, I just zipped up yesterday's version "as is" that exhibits that compile error and attach it to this e-mail. Just unzip it, go into "java9module"

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-18 Thread Alan Bateman
On 17/01/2018 18:53, Rony G. Flatscher wrote: : Would you have concrete suggestions for this use-case, i.e. a framework that is not part of a module, but having a need to access public types from exported packages and get reflective access to objects supertype's protected members? I think

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-17 Thread Rony G. Flatscher
On 17.01.2018 14:12, Alan Bateman wrote: > On 17/01/2018 12:18, Rony G. Flatscher wrote: >> : >> >> The reflection logic in the bridge is (simplified) as follows: >> >> * use the object's 'o' class and look up its declared methods or fields, >> analyze further, if >> member is 'public',

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-17 Thread jeffrey kutcher
Disclaimer: I don't have access to the full picture but wanted to throw this out there. Maybe it will be useful. Maybe you've already considered doing something like this and shot it down a long time ago. I don't know if there are show stoppers and I don't have the end goal in mind. However it

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-17 Thread Alan Bateman
On 17/01/2018 12:18, Rony G. Flatscher wrote: : The reflection logic in the bridge is (simplified) as follows: * use the object's 'o' class and look up its declared methods or fields, analyze further, if member is 'public', otherwise o iterate over all of its superclasses looking

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-17 Thread Rony G. Flatscher
On 16.01.2018 20:38, John Rose wrote: > On Jan 16, 2018, at 10:37 AM, Rony G. Flatscher > wrote: >> >> Well that is probably the core of the problem: who needs to be the subclass, >> the reflector or the >> object to be reflected upon

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread John Rose
On Jan 16, 2018, at 1:08 PM, Jochen Theodorou wrote: > > which is a big deal of a problem if the class, that is supposed to be exposed > to the framework is not under the control of the framework. And there is no > good solution (rewriting the bytecode for example is no good

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread John Rose
On Jan 16, 2018, at 10:37 AM, Rony G. Flatscher wrote: > > Well that is probably the core of the problem: who needs to be the subclass, > the reflector or the > object to be reflected upon (whose inheritance tree is being walked up > towards the root class, and > if

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread Alan Bateman
On 16/01/2018 13:50, Rony G. Flatscher wrote: The excercise here is as follows: * there are classes in "mod_A" which get extended in "mod_B" and once more extended in "mod_C". * Hence "mod_B" requires "mod_A", and "mod_C" requires "mod_B", where "mod_B" exports to "mod_C" only *

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread Rony G. Flatscher
On 16.01.2018 10:18, Alan Bateman wrote: > On 15/01/2018 20:56, Rony G. Flatscher wrote: >> : >> >> So the question is, how can I reflectively access "mtest1.Class01A" static >> protected field >> "myClassName" from "mtest3.Class03a" in Java 9? >> > The scenario in your mail is complicated but if

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread Alan Bateman
On 15/01/2018 20:56, Rony G. Flatscher wrote: : So the question is, how can I reflectively access "mtest1.Class01A" static protected field "myClassName" from "mtest3.Class03a" in Java 9? The scenario in your mail is complicated but if I read it correctly then I would expect this code in

Reflection: how does one access a protected member in a superclass reflectively?

2018-01-15 Thread Rony G. Flatscher
Finally having gained enough time to start rewriting the reflection part for a bridge between a scripting language (ooRexx) and Java 9. >From past discussions on this list my view upon accessing members in >superclasses that are protected in Java 9 is possible as such protected members are