test/java/util/logging/LoggingMXBeanTest.java

Print this page
rev 6099 : 8003380: Compiler warnings in logging test code
Summary: Use generics, suppress warnings where appropriate, remove unused imports, etc.
Reviewed-by: lancea, chegar

@@ -206,11 +206,11 @@
             params[0] = LOGGER_NAME_1;
             signature[0] = "java.lang.String";
             String levelName = (String) mbs.invoke(  objectName, "getLoggerLevel", params, signature );
             l = Level.parse(levelName);
             System.out.print("    Logger1: " );
-            if ( l.equals( l.ALL ) ) {
+            if ( l.equals( Level.ALL ) ) {
                 System.out.println("Level Set to ALL: PASSED" );
                 log1 = true;
             }
             else {
                 System.out.println("Level Set to ALL: FAILED" );

@@ -224,11 +224,11 @@
             params[0] = LOGGER_NAME_2;
             signature[0] = "java.lang.String";
             levelName = (String) mbs.invoke(  objectName, "getLoggerLevel", params, signature );
             l = Level.parse(levelName);
             System.out.print("    Logger2: " );
-            if ( l.equals( l.FINER ) ) {
+            if ( l.equals( Level.FINER ) ) {
                 System.out.println("Level Set to FINER: PASSED" );
                 log2 = true;
             }
             else {
                 System.out.println("Level Set to FINER: FAILED" );

@@ -245,8 +245,8 @@
         System.out.println( "***************** All Tests Passed ****************" );
         System.out.println( "***************************************************" );
     }
 
     public static void main(String[] argv) throws Exception {
-        LoggingMXBeanTest p = new LoggingMXBeanTest();
+        new LoggingMXBeanTest();
     }
 }