-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
The likelyhood of existing method handle filter argument code relying on invocation in argument order from right to left is considered very small, since it is expected most filters will not be stateful in their results.
-
JDK
Summary
Fix the implementation of MethodHandles.filterArguments
to conform to the specification (the pseudocode).
Problem
MethodHandles.filterArguments
pseudocode specifies that the filter method handles are invoked in argument order from left to right. However, the implementation invoked the filter method handles from right to left. This behaviour is observable if the filter arguments retain some global state that affects the results, likely an edge case. However that edge case is exposed for string concatenation using invokedynamic where the toString
implementation has side-effects that affect the String
result (see JDK-8200118).
Solution
Fix the implementation to invoke filter method handles in argument order from left to right.
Specification
This is a behavioral change. There are no specification changes for JDK 10. Specification is clarified in JDK 11 CSR (JDK-8201371).
- csr for
-
JDK-8201502 filterArguments runs multiple filters in the wrong order
- Resolved
- relates to
-
JDK-8201371 filterArguments runs multiple filters in the wrong order
- Closed