harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r802638 - in /harmony/enhanced/classlib/trunk/modules/logging/src: main/java/java/util/logging/LogManager.java test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java
Date Mon, 10 Aug 2009 01:56:22 GMT
Author: qiuxx
Date: Mon Aug 10 01:56:22 2009
New Revision: 802638

URL: http://svn.apache.org/viewvc?rev=802638&view=rev
Log:
Apply for HARMONY-6289, LogManager breaks on subclassing

Modified:
    harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
    harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java?rev=802638&r1=802637&r2=802638&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
Mon Aug 10 01:56:22 2009
@@ -404,7 +404,6 @@
      *             not have the required permissions to perform this action.
      */
     public void readConfiguration() throws IOException {
-        checkAccess();
         // check config class
         String configClassName = System
                 .getProperty("java.util.logging.config.class"); //$NON-NLS-1$
@@ -425,7 +424,7 @@
             InputStream input = null;
             try {
                 input = new BufferedInputStream(new FileInputStream(configFile));
-                readConfigurationImpl(input);
+                readConfiguration(input);
             } finally {
                 if (input != null) {
                     try {

Modified: harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java?rev=802638&r1=802637&r2=802638&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java
Mon Aug 10 01:56:22 2009
@@ -455,6 +455,16 @@
 
 	}
 
+    public void testReadConfiguration() throws SecurityException,
+            IOException {
+
+        MockConfigLogManager lm = new MockConfigLogManager();
+        assertFalse(lm.isCalled);
+
+        lm.readConfiguration();
+        assertTrue(lm.isCalled);
+    }
+
 	private static void checkPropertyNull(LogManager m) {
 		// assertNull(m.getProperty(".level"));
 		assertNull(m.getProperty("java.util.logging.FileHandler.limit"));
@@ -933,6 +943,15 @@
 	public static class MockLogManager extends LogManager {
 	}
 
+	public static class MockConfigLogManager extends LogManager {
+        public boolean isCalled = false;
+
+        public void readConfiguration(InputStream ins) throws IOException {
+            isCalled = true;
+            super.readConfiguration(ins);
+        }
+    }
+
 	public static class MockHandler extends Handler {
 		static int number = 0;
 



Mime
View raw message