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

LengthNotWritableFilter: extraElements.remove(index) has no effect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • None
    • core-libs
    • None

      nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LengthNotWritableFilter.java

      has:

          public ArrayData delete(final int index) {
              extraElements.remove(index);

      but extraElements is of type SortedMap<Long, Object>

      index will get autoboxed to Integer, which is unfortunately not equals to a Long, so this is a no-op.

      (found by running error-prone over the jdk8 sources)

            pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: