JDK-8200118 : [TESTBUG] String concat tests should test toString() application order
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-03-22
  • Updated: 2018-05-08
  • Resolved: 2018-03-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 11
10.0.2Fixed 11 b07Fixed
Related Reports
Blocks :  
Relates :  
Description
This issue covers the potential issue with MH_* strategies in StringConcatFactory that may end up calling toString() on arguments in wrong order. Non MH-strategies appear fine. See the evidence in the wild here:
  https://www.guardsquare.com/en/blog/string-concatenation-java-9-conversion-confusion

This issue adds the relevant test for String concatenation. JDK 10 fails this new test. JDK 11+ passes the test, because the actual bug is JDK-8194554, which is fixed. In other words, StringConcatFactory implementation is actually correct, and it expects filterArguments to run in the specified order. Selectively applying fix from JDK-8194554 to JDK 10 makes it pass.



Comments
Fix Request This test should be backported to jdk10u, to strengthen the testing for failures like JDK-8194554. The new test is being reviewed on core-libs-dev (link above), and the risk for its inclusion is very low. The testing benefits for including the test in the current GA forest outweigh the risk.
22-03-2018

RFR: http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-March/052201.html
22-03-2018

Webrev: http://cr.openjdk.java.net/~shade/8200118/webrev.01/
22-03-2018