RFR: 8255992: JFR EventWriter does not use first string from StringPool with id 0
Aleksey Shipilev
shade at openjdk.java.net
Tue Nov 10 18:01:59 UTC 2020
On Fri, 6 Nov 2020 17:17:16 GMT, Jie Kang <jkang at openjdk.org> wrote:
> This allows string pool entry with id 0 to be written in short form for the event data.
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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1097
More information about the hotspot-jfr-dev
mailing list