Events defined in the java.base module can't reference annotations in the jdk.jfr due to a circular module dependency at compile time.
To work around the issue, the concept of a mirror event was introduced. It adds annotation such as jdk.jfr.Label to a mirror class in the jdk.jfr module but with a target class located in java.base.
To make sure the event class and the mirror have the exact same fields, a verification method was added to the jdk.jfr.internal.jfr.Utils class. Unfortunately the verification mechanism can't handle all cases, and in particular when a field is added to java.lang.Object. This is not a problem in the product, since mirror events are only used internally, but it prevents experimentation, for example to add a field to java.lang.Object.
See attached patch file.
To work around the issue, the concept of a mirror event was introduced. It adds annotation such as jdk.jfr.Label to a mirror class in the jdk.jfr module but with a target class located in java.base.
To make sure the event class and the mirror have the exact same fields, a verification method was added to the jdk.jfr.internal.jfr.Utils class. Unfortunately the verification mechanism can't handle all cases, and in particular when a field is added to java.lang.Object. This is not a problem in the product, since mirror events are only used internally, but it prevents experimentation, for example to add a field to java.lang.Object.
See attached patch file.