harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r489969 - in /harmony/enhanced/classlib/trunk/modules/prefs/src: main/java/java/util/prefs/AbstractPreferences.java test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
Date Sun, 24 Dec 2006 03:01:44 GMT
Author: ndbeyer
Date: Sat Dec 23 19:01:43 2006
New Revision: 489969

URL: http://svn.apache.org/viewvc?view=rev&rev=489969
Log:
Apply patch for HARMONY-2420: [classlib][prefs] java.util.prefs.AbstractPreferences.exportNode(OutputStream)
and java.util.prefs.AbstractPreferences.exportSubtree(OutputStream) throws AssertionError
instead of NPE in a case when OutputStream is null

Modified:
    harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java
    harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java

Modified: harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java?view=diff&rev=489969&r1=489968&r2=489969
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/src/main/java/java/util/prefs/AbstractPreferences.java
Sat Dec 23 19:01:43 2006
@@ -373,7 +373,7 @@
             BackingStoreException {
         if(ostream == null) {
             // prefs.5=Stream is null
-            throw new AssertionError(Messages.getString("prefs.5"));  //$NON-NLS-1$
+            throw new NullPointerException(Messages.getString("prefs.5"));  //$NON-NLS-1$
         }
         checkState();
         XMLParser.exportPrefs(this, ostream, false);
@@ -388,9 +388,8 @@
             BackingStoreException {
         if(ostream == null) {
             // prefs.5=Stream is null
-            throw new AssertionError(Messages.getString("prefs.5"));  //$NON-NLS-1$
+            throw new NullPointerException(Messages.getString("prefs.5"));  //$NON-NLS-1$
         }
-
         checkState();
         XMLParser.exportPrefs(this, ostream, true);
     }

Modified: harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java?view=diff&rev=489969&r1=489968&r2=489969
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java
Sat Dec 23 19:01:43 2006
@@ -1005,7 +1005,8 @@
 		try {
 			pref.exportNode(null);
 			fail();
-		} catch (AssertionError e) {
+		} catch (NullPointerException e) {
+			// Expected
 		}
 
 		pref.putBoolean("key", false);
@@ -1069,7 +1070,8 @@
 		try {
 			pref.exportSubtree(null);
 			fail();
-		} catch (AssertionError e) {
+		} catch (NullPointerException e) {
+			// Expected
 		}
 		ByteArrayOutputStream out = new ByteArrayOutputStream();
 		pref.putBoolean("key", false);



Mime
View raw message