RFR 8159245: Loggers created by system classes are not initialized correctly when configured programmatically from application code.

Mandy Chung mandy.chung at oracle.com
Fri Jul 1 15:09:01 UTC 2016

> On Jul 1, 2016, at 7:09 AM, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> OK. I was concerned about the cost of creating a doPrivileged call
> for nothing - but then reflected that system classes usually call
> getLogger only once for a specific logger - at which point the
> doPrivileged will be needed anyway (only for subsequent calls
> of getLogger with the same name would it be superfluous).
> Here is the new webrev:
> http://cr.openjdk.java.net/~dfuchs/webrev_8159245/webrev.06/

I was thinking to move the entire doPrivileged block to mergeWithSystemLogger that will look like:

    if (cfg == system.config) {

    // sanity check
    if (!system.isSystemLogger …. 
	throw new InternalError(…);
    final ConfigurationData cfg = config;
       config = cfg.merge(system);

 577         checkPermission();

Is this necessary?   Is it be covered by the merge method?


More information about the core-libs-dev mailing list