RFR: 8364316: JFR: Incorrect validation of mirror fields [v2]
Erik Gahlin
egahlin at openjdk.org
Thu Jul 31 08:53:54 UTC 2025
On Wed, 30 Jul 2025 08:28:42 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>
> There might be another quirk in this code: fields of the same name can be hidden, so verification would miss that?
>
I don't think mirror events can be made to work with a class hierarchy (due to shadowing), and there is no need to, since their only purpose is to provide metadata for events defined in java.base (which cannot depend on the jdk.jfr module).
It's fine to have all the metadata directly in the mirror event class.
So, I simplified the traversal code and, at the same time, realized we should not duplicate the logic used to discover which event fields should be included. Now there is only one method, Utils.getEventFields(...), handling this.
The reason I could remove the synthetic check in verifyMirror is that its only purpose was to exclude the startTime and duration fields in the jdk.internal.Event class. The traversal stops before that class is reached, so it's not an issue.
I understand this may be more to review than you are willing to do.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26539#issuecomment-3139086362
More information about the hotspot-jfr-dev
mailing list