1 |
/* java.lang.reflect.Array - manipulate arrays by reflection |
/* java.lang.reflect.Array - manipulate arrays by reflection |
2 |
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
431 |
{ |
{ |
432 |
if (array instanceof Object[]) |
if (array instanceof Object[]) |
433 |
{ |
{ |
434 |
// Too bad Sun won't let us throw the easier ArrayStoreException! |
// Too bad the API won't let us throw the easier ArrayStoreException! |
435 |
if (! array.getClass().getComponentType().isInstance(value)) |
if (value != null |
436 |
throw new IllegalArgumentException(); |
&& ! array.getClass().getComponentType().isInstance(value)) |
437 |
((Object[]) array)[index] = value; |
throw new IllegalArgumentException(); |
438 |
|
((Object[]) array)[index] = value; |
439 |
} |
} |
440 |
else if (value instanceof Boolean) |
else if (value instanceof Boolean) |
441 |
setBoolean(array, index, ((Boolean) value).booleanValue()); |
setBoolean(array, index, ((Boolean) value).booleanValue()); |