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