RFR JDK-8194554: filterArguments runs multiple filters in the wrong order
paul.sandoz at oracle.com
Wed Jan 17 20:16:47 UTC 2018
> On 17 Jan 2018, at 08:50, mandy chung <mandy.chung at oracle.com> wrote:
> This fixes a mismatch between the specification and implementation.
> 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 current implementation whereas the javadoc indicates that
> these filters are run in normal argument order, left-to-right.
Fix looks good, but perhaps the test logic could be made a little simpler?
Since the filter methods update shared state what if they just add their identifier to a list so you can observe [“A”, “B”, C”], or [“B”, “C”] etc.
Then you can test against the the list for the required order of filter calls rather putting logic in the filter methods themselves in what they return (they can just be identity functions with a side-effect).
More information about the core-libs-dev