Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4038371

Provide overloaded methods for java.lang.reflect.Array.set() and java.lang.refle

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 1.1
    • core-libs



      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 - ###@###.###
      ======================================================================

            Unassigned Unassigned
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: