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

SA-JDI: ArrayReference.getValue() throws IndexOutOfBoundsException

XMLWordPrintable

    • beta2
    • generic
    • generic
    • Verified



      Name: ipR10196 Date: 02/27/2004


      -----------------------------------------------------
      Test : nsk/sajdi/ArrayReference/getValue/getvalue001
      VM : ClientVM, ServerVM
      Mode : all
      Platform : generic
      OS : generic
      JDK : 1.5.0-beta2-b40 and earlier
      ------------------------------------------------------

      This SA-JDI test checks if getValue() returns expected values
      of array elements for various kinds of arrays, including
      primitive arrays,object arrays and arrays of arrays.

      Running with legacy JDI connectors this test passes.
      Running with SA-JDI connectors this test reveals that
      IndexOutOfBoundsException is thrown for each array element
      except first one (with index 0). This occurs for arrays
      of all kinds on all platforms.

      Here is typical test output for the following tested array:

          static int[] primArrInt = {2794, -1, 0, 789643, -112};

      -------------------------------------------------------------------
          field #4
            field name: primArrInt
            signature: [I
            ... found expected field #4
            ArrayReference: instance of int[5] (id=5)
            length: 5
              item #0
                value: 2794
                equal: true
              item #1
          java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      at java.util.ArrayList.get(ArrayList.java:322)
      at sun.jvm.hotspot.jdi.ArrayReferenceImpl.getValue(ArrayReferenceImpl.java:47)
      at nsk.sajdi.ArrayReference.getValue.getvalue001.checkArrayValue(getvalue001.java:530)
      at nsk.sajdi.ArrayReference.getValue.getvalue001.checkFieldValue(getvalue001.java:486)
      at nsk.sajdi.ArrayReference.getValue.getvalue001.runIt(getvalue001.java:388)
      at nsk.sajdi.ArrayReference.getValue.getvalue001.run(getvalue001.java:26)
      at nsk.sajdi.ArrayReference.getValue.getvalue001.main(getvalue001.java:21)
          <...>
      # ERROR: ArrayReference.getValue() throws unexpected exception:
      # ERROR: field name: primArrInt
      # ERROR: signature: [I
      # ERROR: array obj: instance of int[5] (id=5)
      # ERROR: length: 5
      # ERROR: index: 1
      # ERROR: exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      # ERROR: ArrayReference.getValue() throws unexpected exception:
      # ERROR: field name: primArrInt
      # ERROR: signature: [I
      # ERROR: array obj: instance of int[5] (id=5)
      # ERROR: length: 5
      # ERROR: index: 2
      # ERROR: exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      # ERROR: ArrayReference.getValue() throws unexpected exception:
      # ERROR: field name: primArrInt
      # ERROR: signature: [I
      # ERROR: array obj: instance of int[5] (id=5)
      # ERROR: length: 5
      # ERROR: index: 3
      # ERROR: exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      # ERROR: ArrayReference.getValue() throws unexpected exception:
      # ERROR: field name: primArrInt
      # ERROR: signature: [I
      # ERROR: array obj: instance of int[5] (id=5)
      # ERROR: length: 5
      # ERROR: index: 4
      # ERROR: exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      -------------------------------------------------------------------

      To reproduce this failure:
        cd /net/jano.sfbay/export/disk20/GammaBase/Bugs/<this bug number>
        sh build.sh $JAVA_HOME
        sh run.sh [-pid | -core | -socket] [-g] [-v] $JAVA_HOME [JAVA_OPTS]
      where:
          -pid - run test with SA-JDI pid attaching connector (default)
          -core - run test with SA-JDI core attaching connector
          -socket - run test with JDI socket attaching connector
          -g - run test with java_g binaries
          -v - run test in verbose mode

      This test will appear in the next r27 testbase release.
      Running on Linux this test may fail due to known bug:
      4996081 SA-JDI: SAPIDAttachingConnector.attach() throws IOEception on RH AS2.1

      ======================================================================

            sundar Sundararajan Athijegannathan
            popovsunw Popov Popov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: