[9] RFR: 8177136: Caller sensitive method System.getLogger should specify what happens if there is no caller on the stack.
Daniel Fuchs
daniel.fuchs at oracle.com
Tue Mar 21 12:44:53 UTC 2017
Hi,
Please find below an updated patch for:
8177136: Caller sensitive method System.getLogger should specify
what happens if there is no caller on the stack.
https://bugs.openjdk.java.net/browse/JDK-8177136
webrev:
http://cr.openjdk.java.net/~dfuchs/webrev_8177136/webrev.01
System.getLogger(name) and System.getLogger(name, resourceBundle)
are specified to call LoggerFinder to obtain a logger, which requires
the module of the caller class.
When there is no java frame on the stack, then the caller information
cannot be obtained and there is not enough context to know which module
would be appropriate.
The proposal is to throw IllegalCallerException - which is the exception
that StackWalker::getCallerClass will throw if called by
System::getLogger in this case.
This RFR follows the discussion started here:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046868.html
best regards,
-- daniel
More information about the core-libs-dev
mailing list