Reflection: how does one access a protected member in a superclass reflectively?
Rony G. Flatscher
Rony.Flatscher at wu.ac.at
Mon Jan 22 15:18:03 UTC 2018
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
>> ----------------------------------------------------------------------------------------------------
>>
>> Dear Alan:
>>
>> tried to come up with a "cleaner" version to zip it up, however the error would not occur there.
> The attachment was dropped too.
OK, next time, I will use Dropbox or the like instead.
> When you say "the error would not occur there" then do you mean it won't compile? I wouldn't
> expect the test to compile with a reference to the protected member so maybe the issue was that
> the code was compiled in a different way and so only found when you ran.
Looked into it and you are probably right, the class file was a few minutes older than the latest
version of the java file. Deleting the class file and trying to recompile yields the expected error
"...has protected access in Class01A..." and there is no public getter defined for that field in any
of the classes in the exported packages.
---rony
More information about the jigsaw-dev
mailing list