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:19:16 UTC 2016


> On Jul 1, 2016, at 8:16 AM, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> 
> On 01/07/16 16:09, Mandy Chung wrote:
>> I was thinking to move the entire doPrivileged block to mergeWithSystemLogger that will look like:
>> 
>>    if (cfg == system.config) {
>>        return;
>>    }
>> 
>>    // sanity check
>>    if (!system.isSystemLogger ….
>> 	throw new InternalError(…);
>> 
>>    final ConfigurationData cfg = config;
>>    AC.doPrivileged(...
>>       config = cfg.merge(system);
>>    )
>> 
>> 
>> 577         checkPermission();
>> 
>> Is this necessary?   Is it be covered by the merge method?
> 
> I'd prefer to keep the doPrivileged in LogManager so that
> Logger.mergeWithSystemLogger can call checkpermission().
> 
> From a conceptual point of view it's only when calling
> this method from LogManager that we want to be privileged,
> even though the method is package private and only called
> from LogManager…

Why is this extra checkPermission necessary? 

Mandy


More information about the core-libs-dev mailing list