JShell and illegal reflective access warning

Cay Horstmann cay.horstmann at sjsu.edu
Thu Nov 2 06:01:08 UTC 2017


With Java 9, I get a stern warning when running a program that executes

       String.class.getDeclaredField("value").setAccessible(true);

But in JShell, the statement doesn't generate a warning. Wouldn't it be 
a good idea if it did?

(You do get the expected warning when running jshell --execution local)

Cheers,

Cay

-- 

Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com


More information about the kulla-dev mailing list