RFR JDK-8194554: filterArguments runs multiple filters in the wrong order
paul.sandoz at oracle.com
Wed Jan 17 20:31:17 UTC 2018
> On 17 Jan 2018, at 12:29, mandy chung <mandy.chung at oracle.com> wrote:
> On 1/17/18 12:16 PM, Paul Sandoz wrote:
>>> On 17 Jan 2018, at 08:50, mandy chung <mandy.chung at oracle.com> <mailto:mandy.chung at oracle.com> wrote:
>>> http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8194554/webrev.00/ <http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8194554/webrev.00/>
>>> 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).
> That's a good idea (I should have started with a simpler test).
> http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8194554/webrev.01/ <http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8194554/webrev.01/>
More information about the core-libs-dev