From d2c44cf80e94f1ef17462a98b7aced23843cbd68 Mon Sep 17 00:00:00 2001 From: jgish Date: Sat, 13 Oct 2012 10:15:57 +0100 Subject: [PATCH] 7146552: java/util/logging/LoggingMXBeanTest.java failing intermittently Reviewed-by: alanb, mchung --- test/java/util/logging/LoggingMXBeanTest.java | 8 +++++--- test/java/util/logging/LoggingMXBeanTest2.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/java/util/logging/LoggingMXBeanTest.java b/test/java/util/logging/LoggingMXBeanTest.java index e6c694d37..a01e57c13 100644 --- a/test/java/util/logging/LoggingMXBeanTest.java +++ b/test/java/util/logging/LoggingMXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,8 @@ public class LoggingMXBeanTest ObjectName objectName = null; static String LOGGER_NAME_1 = "com.sun.management.Logger1"; static String LOGGER_NAME_2 = "com.sun.management.Logger2"; + static Logger logger1; + static Logger logger2; public LoggingMXBeanTest() throws Exception { @@ -131,8 +133,8 @@ public class LoggingMXBeanTest System.out.println( "*********** Phase 3 ***********" ); System.out.println( "*******************************" ); System.out.println( " Create and test new Loggers" ); - Logger logger1 = Logger.getLogger( LOGGER_NAME_1 ); - Logger logger2 = Logger.getLogger( LOGGER_NAME_2 ); + logger1 = Logger.getLogger( LOGGER_NAME_1 ); + logger2 = Logger.getLogger( LOGGER_NAME_2 ); // check that Level object are returned properly try { diff --git a/test/java/util/logging/LoggingMXBeanTest2.java b/test/java/util/logging/LoggingMXBeanTest2.java index 37b6aceb0..005ed72e0 100644 --- a/test/java/util/logging/LoggingMXBeanTest2.java +++ b/test/java/util/logging/LoggingMXBeanTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,12 +42,14 @@ public class LoggingMXBeanTest2 static String LOGGER_NAME_1 = "com.sun.management.Logger"; static String LOGGER_NAME_2 = "com.sun.management.Logger.Logger2"; static String UNKNOWN_LOGGER_NAME = "com.sun.management.Unknown"; + static Logger logger1; + static Logger logger2; public LoggingMXBeanTest2() throws Exception { - Logger logger1 = Logger.getLogger( LOGGER_NAME_1 ); + logger1 = Logger.getLogger( LOGGER_NAME_1 ); logger1.setLevel(Level.FINE); - Logger logger2 = Logger.getLogger( LOGGER_NAME_2 ); + logger2 = Logger.getLogger( LOGGER_NAME_2 ); logger2.setLevel(null); /* -- GitLab