harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r464501 - in /incubator/harmony/enhanced/classlib/trunk/modules/logging/src: main/java/java/util/logging/Logger.java test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
Date Mon, 16 Oct 2006 14:06:50 GMT
Author: pyang
Date: Mon Oct 16 07:06:49 2006
New Revision: 464501

URL: http://svn.apache.org/viewvc?view=rev&rev=464501
Log:
Should not throw NPE when Logger.getLogger(somename, null)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Logger.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Logger.java?view=diff&rev=464501&r1=464500&r2=464501
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Logger.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Logger.java
Mon Oct 16 07:06:49 2006
@@ -313,6 +313,9 @@
     private static void updateResourceBundle(Logger l, String resourceBundleName) {
         synchronized (l) {
             if (null == l.getResourceBundleName()) {
+                if(null == resourceBundleName){
+                    return;
+                }
                 /*
                  * load the resource bundle if none is specified
                  * before

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.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/LoggerTest.java?view=diff&rev=464501&r1=464500&r2=464501
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/LoggerTest.java
Mon Oct 16 07:06:49 2006
@@ -316,6 +316,9 @@
 			fail("Should throw NullPointerException!");
 		} catch (NullPointerException e) {
 		}
+        Logger logger = Logger.getLogger("", null);
+        assertNull(logger.getResourceBundleName());
+        assertNull(logger.getResourceBundle());        
 	}
 
 	/*



Mime
View raw message