harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r441133 - /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Array.java
Date Thu, 07 Sep 2006 16:17:43 GMT
Author: geirm
Date: Thu Sep  7 09:17:42 2006
New Revision: 441133

URL: http://svn.apache.org/viewvc?view=rev&rev=441133
Log:
Two things : 

1) Fix from HARMONY-1289 - no reason to throw an NPE when 
   the value is null.

2) Added a quick-fail NPE in case the array itself is null, as
  specificed by the spec


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Array.java

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Array.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Array.java?view=diff&rev=441133&r1=441132&r2=441133
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Array.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Array.java
Thu Sep  7 09:17:42 2006
@@ -221,6 +221,11 @@
      */
     public static void set(Object array, int index, Object value)
         throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
+    	
+    	if (array == null) {
+    		throw new NullPointerException();
+    	}
+    	
         try {
             ((Object[])array)[index] = value;
             return;
@@ -254,9 +259,6 @@
             }
         } catch (ArrayStoreException e) {
             throw new IllegalArgumentException(e.getMessage());
-        }
-        if (value == null) {
-            throw new NullPointerException();
         }
         throw new IllegalArgumentException(
             "Can not assign the specified value to the specified array component");



Mime
View raw message