Better tools for adjusting to strong encapsulation
simon at cjnash.com
Fri Mar 24 17:48:04 UTC 2017
On 24/03/2017 13:02, Alan Bateman wrote:
> On 24/03/2017 12:01, Peter Levart wrote:
>> Just a reminder that System.err field is "writable" and therefore
>> System.setErr(PrintStream) can be used to redirect output to execute
>> arbitrary code...
> That's right, it needs to captured at startup or sent directly to stderr.
I think this means that at startup, an application could do
PrintStream sysErr = System.err;
where myErr is an application subclass of PrintStream that filters out any
unwanted warnings produced by JDK code and sends all other output to sysErr.
Would this work?
More information about the jigsaw-dev