various bugfixes and tweaks in reflection

This commit is contained in:
Joel Dice
2007-11-20 13:40:07 -07:00
parent ded1016b32
commit 6fe0c4636f
3 changed files with 17 additions and 11 deletions

View File

@ -68,10 +68,14 @@ public final class Array {
break;
case 'L':
case '[':
if (array.getClass().getComponentType().isInstance(value)) {
if (value == null
|| array.getClass().getComponentType().isInstance(value))
{
((Object[]) array)[index] = value;
} else {
throw new IllegalArgumentException();
throw new IllegalArgumentException
("need " + array.getClass().getComponentType() +
", got " + value.getClass().getName());
}
break;