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

SA-JDI: ArrayReference.getValues(int,int) returns wrong number of elements

XMLWordPrintable

    • generic
    • generic



      Name: ipR10196 Date: 03/01/2004


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

      This SA-JDI test checks if getValues(int,int) returns
      expected number of array elements, and each of returned values
      is equal to value returned by getValue() for corresponding index.

      Running with legacy JDI connectors this test passes.
      Running with SA-JDI connectors getValues(start,length)
      returns wrong number of values, actually it returns
      '(length - start)' values number instead of expected
      'length' values. The same values number is returned
      even if 'length' is passed as -1.

      I slightly modified original testcase to clearly illustrate
      this failure and do not suffer from known bugs:

        5004867 SA-JDI: ArrayReference.getValue() throws IndexOutOfBoundsException
        5004851 SA-JDI: ArrayReference.getValues() and getValues(int,int) work incorrectly

      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
            ... check ArrayReference.getValues(0,1)
              list size: 1
              item #0
                value: 2794
            ... check ArrayReference.getValue(1,4)
              list size: 3
      # ERROR: ArrayReference.getValues(start,length) returned unexpected elements count:
      # ERROR: field name: primArrInt
      # ERROR: signature: [I
      # ERROR: array obj: instance of int[5] (id=5)
      # ERROR: array size: 5
      # ERROR: start: 1
      # ERROR: length: 4
      # ERROR: got list: [-1, 0, 789643]
      # ERROR: list size: 3
      # ERROR: expected: 4
              item #1
                value: -1
              item #2
                value: 0
              item #3
                value: 789643
      -------------------------------------------------------------------

      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: