LengthNotWritableFilter: extraElements.remove(index) has no effect

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 10
    • Affects Version/s: None
    • Component/s: 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)

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

              Created:
              Updated:
              Resolved: