harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r425595 - in /incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging: Level.java LogRecord.java Logger.java StreamHandler.java
Date Wed, 26 Jul 2006 03:28:24 GMT
Author: ndbeyer
Date: Tue Jul 25 20:28:24 2006
New Revision: 425595

URL: http://svn.apache.org/viewvc?rev=425595&view=rev
Log:
Add more descriptive messages to NPEs.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
    incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogRecord.java
    incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Logger.java
    incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java?rev=425595&r1=425594&r2=425595&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/Level.java
Tue Jul 25 20:28:24 2006
@@ -193,7 +193,7 @@
      */
     protected Level(String name, int level, String resourceBundleName) {
         if (null == name) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'name' parameter is null."); //$NON-NLS-1$
         }
         this.name = name;
         this.value = level;
@@ -255,7 +255,7 @@
      */
     public static final Level parse(String name) {
         if (null == name) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'name' parameter is null."); //$NON-NLS-1$
         }
         // Check if the name is a predefined one
         Level result = levels.get(name);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogRecord.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogRecord.java?rev=425595&r1=425594&r2=425595&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogRecord.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/LogRecord.java
Tue Jul 25 20:28:24 2006
@@ -176,7 +176,7 @@
      */
     public LogRecord(Level level, String msg) {
         if (null == level) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'level' parameter is null."); //$NON-NLS-1$
         }
         this.level = level;
         this.message = msg;
@@ -225,7 +225,7 @@
      */
     public void setLevel(Level level) {
         if (null == level) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'level' parameter is null."); //$NON-NLS-1$
         }
         this.level = level;
     }

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?rev=425595&r1=425594&r2=425595&view=diff
==============================================================================
--- 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
Tue Jul 25 20:28:24 2006
@@ -415,7 +415,7 @@
      */
     public synchronized void addHandler(Handler handler) {
         if (null == handler) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'handler' parameter is null."); //$NON-NLS-1$
         }
         // Anonymous loggers can always add handlers
         if (this.isNamed) {
@@ -449,7 +449,7 @@
             LogManager.getLogManager().checkAccess();
         }
         if (null == handler) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'handler' parameter is null."); //$NON-NLS-1$
         }
         this.handlers.remove(handler);
     }
@@ -579,7 +579,7 @@
      */
     public synchronized void setParent(Logger parent) {
         if (null == parent) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+            throw new NullPointerException("The 'parent' parameter is null."); //$NON-NLS-1$
         }
         // even anonymous loggers are checked
         LogManager.getLogManager().checkAccess();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java?rev=425595&r1=425594&r2=425595&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
Tue Jul 25 20:28:24 2006
@@ -120,8 +120,11 @@
      */
     public StreamHandler(OutputStream os, Formatter formatter) {
         this();
-        if (null == os || null == formatter) {
-            throw new NullPointerException("null"); //$NON-NLS-1$
+        if (os == null) {
+            throw new NullPointerException("The OutputStream parameter is null");
+        }
+        if (formatter == null) {
+            throw new NullPointerException("The Formatter parameter is null.");
         }
         this.os = os;
         internalSetFormatter(formatter);



Mime
View raw message