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.
Chen Liang ________________________________ From: core-libs-dev <[email protected]> on behalf of Claes Redestad <[email protected]> Sent: Thursday, September 18, 2025 8:55 AM To: wenshao <[email protected]> Cc: core-libs-dev <[email protected]> Subject: Re: Proposal to remove StringConcatFactory#generateMHInlineCopy Hi, I think it was https://bugs.openjdk.org/browse/JDK-8336856 which made the old generateMHInline non-default / opt-in. 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. Thanks! Claes > 17 sep. 2025 kl. 03:13 skrev wenshao <[email protected]>: > > With the introduction of 8338930: StringConcatFactory hardCoded string > concatenation strategy, the StringConcatFactory#generateMHInlineCopy method > is no longer used by default. > > ```java > public final class StringConcatFactory { > private static final int HIGH_ARITY_THRESHOLD; > static { > String highArity = > VM.getSavedProperty("java.lang.invoke.StringConcat.highArityThreshold"); > HIGH_ARITY_THRESHOLD = highArity != null ? Integer.parseInt(highArity) > : 0; > } > public static CallSite makeConcatWithConstants(MethodHandles.Lookup lookup, > String name, > MethodType concatType, > String recipe, > Object... constants) > throws StringConcatException > { > MethodHandle mh = makeSimpleConcat(concatType, constantStrings); > if (mh == null && concatType.parameterCount() <= > HIGH_ARITY_THRESHOLD) { > mh = generateMHInlineCopy(concatType, constantStrings); // no > longer used by default. > } > } > } > ``` > > After a year of community use, the InlineHiddenClassStrategy has proven to > work well, so I recommend removing the implementation of > StringConcatFactory#generateMHInlineCopy. > > - > Shaojin Wen >
