<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I agree with the removal. If we need to restore it, we can always pull it from the git history, or just revert the removal commit.</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Chen Liang</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of Claes Redestad <claes.redestad@oracle.com><br>
<b>Sent:</b> Thursday, September 18, 2025 8:55 AM<br>
<b>To:</b> wenshao <shaojin.wensj@alibaba-inc.com><br>
<b>Cc:</b> core-libs-dev <core-libs-dev@openjdk.org><br>
<b>Subject:</b> Re: Proposal to remove StringConcatFactory#generateMHInlineCopy</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi,<br>
<br>
I think it was <a href="https://bugs.openjdk.org/browse/JDK-8336856">https://bugs.openjdk.org/browse/JDK-8336856</a> which made the old generateMHInline non-default / opt-in.
<br>
<br>
But yes, I’ve planned proposing a removal of this for JDK 26. If you want to file an RFE and work out a PR I’d be happy to approve, otherwise it’s on my to-do list.<br>
<br>
Thanks!<br>
<br>
Claes  <br>
<br>
> 17 sep. 2025 kl. 03:13 skrev wenshao <shaojin.wensj@alibaba-inc.com>:<br>
> <br>
> With the introduction of 8338930: StringConcatFactory hardCoded string concatenation strategy, the StringConcatFactory#generateMHInlineCopy method is no longer used by default.<br>
> <br>
> ```java<br>
> public final class StringConcatFactory {<br>
>    private static final int HIGH_ARITY_THRESHOLD;<br>
>    static {<br>
>        String highArity = VM.getSavedProperty("java.lang.invoke.StringConcat.highArityThreshold");<br>
>        HIGH_ARITY_THRESHOLD = highArity != null ? Integer.parseInt(highArity) : 0;<br>
>    }<br>
>    public static CallSite makeConcatWithConstants(MethodHandles.Lookup lookup,<br>
>                                                  String name,<br>
>                                                  MethodType concatType,<br>
>                                                  String recipe,<br>
>                                                  Object... constants)<br>
>        throws StringConcatException<br>
>    {<br>
>            MethodHandle mh = makeSimpleConcat(concatType, constantStrings);<br>
>            if (mh == null && concatType.parameterCount() <= HIGH_ARITY_THRESHOLD) {<br>
>                mh = generateMHInlineCopy(concatType, constantStrings); // no longer used by default.<br>
>            }<br>
>    }<br>
> }<br>
> ```<br>
> <br>
> After a year of community use, the InlineHiddenClassStrategy has proven to work well, so I recommend removing the implementation of StringConcatFactory#generateMHInlineCopy.<br>
> <br>
> -<br>
> Shaojin Wen<br>
> <br>
<br>
</div>
</span></font></div>
</body>
</html>