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

filterArguments runs multiple filters in the wrong order

    XMLWordPrintable

Details

    Backports

      Description

        If MethodHandles.filterArguments is used to apply two or more non-null filters to a method handle, those filters will be run in right-to-left order in the OpenJDK implementation. The javadoc indicates that these filters are run in normal argument order, left-to-right; IBM's implementation correctly implements this specification. If we have unit tests for this, they are probably using filter functions with no side effects, so it is impossible to detect the error.

        Suggested fix: Run the accumulation loop backwards over the array of filters. And put in a regression test with side-effecting filters.

        Links:
        http://mail.openjdk.java.net/pipermail/mlvm-dev/2018-January/006789.html
        http://mail.openjdk.java.net/pipermail/mlvm-dev/2018-January/006798.html

        Attachments

          Issue Links

            Activity

              People

                mchung Mandy Chung
                jrose John Rose
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: