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

com.sun.openpisces.Dasher throws java.lang.ArrayIndexOutOfBoundsException in method goTo

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u15
    • javafx
    • Mac OS 10.8.2

      com.sun.openpisces.Dasher can cause an ArrayIndexOutOfBoundsException to be thrown at line 159, during a call to System.arraycopy.

                     firstSegmentsBuffer =
                              Helpers.widenArray(firstSegmentsBuffer,
                                      firstSegidx, type - 2);
                      firstSegmentsBuffer[firstSegidx++] = type;
                      System.arraycopy(pts, off, firstSegmentsBuffer, firstSegidx, type - 2);

      Since firstSegidx is increased by 1 after firstSegmentsBuffer has been widened to make room for (type - 2) more elements, the arraycopy will fail if (firstSegidx + type - 2) is equal to (firstSegmentsBuffer.length).

      Changing the last argument in the call to Helpers.widenArray from (type -2) to (type -1) should solve the problem.

            flar Jim Graham
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: