src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedEvent.java
branchJEP-349-branch
changeset 57460 bcbc53560c77
parent 57452 6fabe73e5d9a
child 58112 e7754025004b
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedEvent.java	Mon Jul 08 18:11:26 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedEvent.java	Mon Jul 08 23:08:05 2019 +0200
@@ -39,14 +39,12 @@
  * @since 9
  */
 public final class RecordedEvent extends RecordedObject {
-    private final EventType eventType;
     long startTimeTicks;
     long endTimeTicks;
 
     // package private
-    RecordedEvent(EventType type, List<ValueDescriptor> vds, Object[] values, long startTimeTicks, long endTimeTicks, TimeConverter timeConverter) {
-        super(vds, values, timeConverter);
-        this.eventType = type;
+    RecordedEvent(ObjectContext objectContext, Object[] values, long startTimeTicks, long endTimeTicks) {
+        super(objectContext, values);
         this.startTimeTicks = startTimeTicks;
         this.endTimeTicks = endTimeTicks;
     }
@@ -77,7 +75,7 @@
      * @return the event type, not {@code null}
      */
     public EventType getEventType() {
-        return eventType;
+        return objectContext.eventType;
     }
 
     /**
@@ -118,7 +116,7 @@
      */
     @Override
     public List<ValueDescriptor> getFields() {
-        return getEventType().getFields();
+        return objectContext.fields;
     }
 
     protected final Object objectAt(int index) {
@@ -135,14 +133,14 @@
     }
 
     private boolean hasDuration() {
-        return objects.length + 2 == descriptors.size();
+        return objects.length + 2 == objectContext.fields.size();
     }
 
     private long getStartTimeNanos() {
-        return timeConverter.convertTimestamp(startTimeTicks);
+        return objectContext.timeConverter.convertTimestamp(startTimeTicks);
     }
 
     private long getEndTimeNanos() {
-        return timeConverter.convertTimestamp(endTimeTicks);
+        return objectContext.timeConverter.convertTimestamp(endTimeTicks);
     }
 }