RFR: 8266972: Use String.concat() in j.l.Class where invokedynamic-based String concatenation is not available [v5]

Сергей Цыпанов github.com+10835776+stsypanov at openjdk.java.net
Thu Jul 8 08:57:53 UTC 2021


On Wed, 12 May 2021 13:12:07 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> But isn't `componentType.descriptorString()` does this itself? Also multi-dimensional arrays are quite an infrequent usecase, aren't they?
>
> Yeah, it's just an optimization. Current code wouldbuild "[[..[[LFoo;" by recursively going down to `Foo`, build and return "LFoo;", then do "[" + "LFoo;", and so on. Infrequent enough that we can ignore it, sure, but since it's effectively reducing the algorithmic complexity from O(n*m) to O(n+m) I should at least mention it.

I see that `TestPrimitiveArrayCriticalWithBadParam` constantly fails, so I'd probably revert this change

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

PR: https://git.openjdk.java.net/jdk/pull/3627


More information about the core-libs-dev mailing list