RFR: 8339704: Refactor StringConcatHelper simpleConcat [v7]

Shaojin Wen swen at openjdk.org
Mon Oct 7 01:02:45 UTC 2024


On Tue, 10 Sep 2024 13:13:22 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> The string concatenation of the java.base module is implemented using StringBuilder. By providing a series of concat methods in StringConcatHelper, it is used in the java.lang package to replace string concatenation.
>> 
>> These concat methods can also be exposed through JLA for use by other packages, such as java.lang.constant.
>> 
>> These concat methods can replace Concat1 and become part of StringConcatFactory#simpleConcat
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove 2 arguments simple concat

Similar to InnerClassLambdaMetafactory line 181

argNames[i] = "arg$" + (i + 1);

we need to provide concat(String, int) directly inside java.base, which is why I submitted this PR.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20726#issuecomment-2395699499


More information about the core-libs-dev mailing list