RFR: 8177136: Caller sensitive method System.getLogger should specify what happens if there is no caller on the stack.
daniel.fuchs at oracle.com
Tue Mar 21 12:44:53 UTC 2017
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.
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:
More information about the core-libs-dev