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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u15
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      Mac OS 10.8.2

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              flar Jim Graham
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: