JFR uses dynamic proxies to get data, i.e. eventType.getAnnotation(MirrorEvent.class). This is convenient, but for known JDK classes we could get the annotation values directly without spinning up a proxy class, i.e.
String getMirrorClass() {
for (var a : eventType.getAnnotationElements()) {
if (a.getTypeId() == MIRROR_EVENT_TYPE_ID) {
return (String)a.getValue("value");
}
}
return null;
}
String getMirrorClass() {
for (var a : eventType.getAnnotationElements()) {
if (a.getTypeId() == MIRROR_EVENT_TYPE_ID) {
return (String)a.getValue("value");
}
}
return null;
}