RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v6]
Chen Liang
liach at openjdk.org
Fri Sep 6 01:03:52 UTC 2024
On Fri, 6 Sep 2024 00:45:14 GMT, Shaojin Wen <swen at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line 1288:
>>
>>> 1286: if (staticConcat) {
>>> 1287: clb.withSuperclass(CD_Object)
>>> 1288: .withFlags(ACC_FINAL | ACC_SUPER | ACC_SYNTHETIC);
>>
>> According to #19517, project lilliput wants utility classes to be declared `abstract` instead of `final` so their pointers won't be encodable in object headers
>
> Do I need to declare it as ACC_INTERFACE? Many utility classes do this.
interface has extra restrictions that can fail class validation, such as fields must be public static final. So I recommend just using abstract class.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20675#discussion_r1746356802
More information about the core-libs-dev
mailing list