JFR: Reduce use of dynamic proxies

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 23
    • Affects Version/s: None
    • Component/s: hotspot
    • None
    • jfr
    • b22

      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;
      }

            Assignee:
            Erik Gahlin
            Reporter:
            Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: