8172971: java.management could use System.Logger

Daniel Fuchs daniel.fuchs at oracle.com
Thu Jan 19 18:50:47 UTC 2017


Hi Mandy,

Thanks for the review!

On 19/01/17 17:12, Mandy Chung wrote:
>
>> On Jan 19, 2017, at 7:30 AM, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
>>
>> Hi,
>>
>> Please find below a patch for:
>>
>> 8172971: java.management could use System.Logger
>> https://bugs.openjdk.java.net/browse/JDK-8172971
>>
>> webrev:
>> http://cr.openjdk.java.net/~dfuchs/webrev_8172971/webrev.00/
>>
>
> This looks good in general and pretty straight forward change.
>
> Is it intentional to change the level FINEST to DEBUG as opposed to TRACE in a couple places?  For example,

The regular mapping would be:
   [CONFIG,FINE]  -> DEBUG,
   [FINER,FINEST] -> TRACE.

There are a couple of places were unexpected exceptions where traced
at level FINEST, and I arbitrarily decided that they should rather
be traced with level DEBUG.

> src/java.management/share/classes/javax/management/MBeanServerFactory.java
> -            if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
> +            if (MBEANSERVER_LOGGER.isLoggable(Level.DEBUG)) {
>
> src/java.management/share/classes/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.java
> -                if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
> -                    MBEANSERVER_LOGGER.logp(Level.FINEST,
> -                            MBeanServerDelegateImpl.class.getName(),
> -                            "getAttributes",
> +                if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
> +                    MBEANSERVER_LOGGER.log(Level.TRACE,
>                              "Attribute " + attn[i] + " not found");
>                  }
>
>> I have also added a new test:
>> test/sun/management/LoggingTest/LoggingTest.java
>
> This test should have @modules java.logging and java.management.

OK - I believed @modules java.management should already be in TEST.ROOT
I will double check.

best regards,

-- daniel
>
> Mandy
>



More information about the core-libs-dev mailing list