harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r437594 - in /incubator/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, 28 Aug 2006 08:10:16 GMT
Author: pyang
Date: Mon Aug 28 01:10:15 2006
New Revision: 437594

URL: http://svn.apache.org/viewvc?rev=437594&view=rev
Log:
Patch applied for HARMONY-1286 ([classlib][logging] LogManager.addLogger(Logger) throws unexpected
AccessControlException when SecurityManager is enabled.)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java?rev=437594&r1=437593&r2=437594&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogManager.java
Mon Aug 28 01:10:15 2006
@@ -315,13 +315,13 @@
         while ((lastSeparator = parentName.lastIndexOf('.')) != -1) {
             parentName = parentName.substring(0, lastSeparator);
             if ((parent = loggers.get(parentName)) != null) {
-                logger.setParent(parent);
+                logger.internalSetParent(parent);
                 break;
             }
         }
         if (parent == null && parent != root) {
             parent = root;
-            logger.setParent(parent);
+            logger.internalSetParent(parent);
         }
 
         // find children

Modified: incubator/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/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java?rev=437594&r1=437593&r2=437594&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java
Mon Aug 28 01:10:15 2006
@@ -336,6 +336,22 @@
 		assertNotSame(root, manager.getLogger(""));
 	}
 
+	/**
+	 * @tests java.util.logging.LogManager#addLogger(Logger)
+	 */
+	public void test_addLoggerLLogger_Security() throws Exception {
+		// regression test for Harmony-1286
+		SecurityManager originalSecurityManager = System.getSecurityManager();
+		System.setSecurityManager(new SecurityManager());
+		try {
+			LogManager manager = LogManager.getLogManager();
+			manager.addLogger(new MockLogger("mock", null));
+			manager.addLogger(new MockLogger("mock.child", null));
+		} finally {
+			System.setSecurityManager(originalSecurityManager);
+		}
+	}
+	
 	public void testDefaultLoggerProperties() {
 		// mock LogManager has no default logger
 		assertNull(mockManager.getLogger(""));



Mime
View raw message