RFR: 8255992: JFR EventWriter does not use first string from StringPool with id 0 [v2]
Jie Kang
jkang at openjdk.java.net
Tue Nov 10 18:45:11 UTC 2020
On Tue, 10 Nov 2020 17:58:37 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Jie Kang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Compare against zero instead of negative one
>
> src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriter.java line 132:
>
>> 130: if (length > StringPool.MIN_LIMIT && length < StringPool.MAX_LIMIT) {
>> 131: long l = StringPool.addString(s);
>> 132: if (l > -1) {
>
> I cannot vouch for the correctness of this patch, but I would suggest to style new check as `if (l >= 0)`. Not only this looks cleaner, the comparisons with zero are tad more efficient.
Thanks. I've updated following your recommendation.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1097
More information about the hotspot-jfr-dev
mailing list