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

LengthNotWritableFilter: extraElements.remove(index) has no effect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None

      Description

      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)

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: