-
Enhancement
-
Resolution: Won't Fix
-
P5
-
None
-
1.1
-
sparc
-
solaris_2.5.1
Name: mc57594 Date: 03/12/97
It ought to be possible to set an Array element or Field value
from an arbitrary value without having to know if it is a
primitive type or not. This would be possible if there were versions
of the java.lang.reflect.Array.set() and java.lang.reflect.Field.set()
methods that took integral and floating point types as arguments:
Array:
public static void set(Object array, int index, long value)
public static void set(Object array, int index, double value)
Field:
public void set(Object obj, long value)
public void set(Object obj, double value)
As things stand now, there are setByte(), etc., methods, requiring
the programmer to know at compile time what the type of the value
is. This makes building a dynamic expression evaluator, for
instance, very difficult.
company - GemSTone Systems, Inc. , email - ###@###.###
======================================================================