src/jdk.jfr/share/classes/jdk/jfr/consumer/ObjectFactory.java
branchJEP-349-branch
changeset 57460 bcbc53560c77
parent 57360 5d043a159d5c
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/ObjectFactory.java	Mon Jul 08 18:11:26 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/ObjectFactory.java	Mon Jul 08 23:08:05 2019 +0200
@@ -25,9 +25,6 @@
 
 package jdk.jfr.consumer;
 
-import java.util.List;
-
-import jdk.jfr.ValueDescriptor;
 import jdk.jfr.internal.Type;
 
 /**
@@ -65,10 +62,10 @@
         return null;
     }
 
-    private final List<ValueDescriptor> valueDescriptors;
+    private final ObjectContext objectContext;
 
-    ObjectFactory(Type type) {
-        this.valueDescriptors = type.getFields();
+    ObjectFactory(Type type, TimeConverter timeConverter) {
+        this.objectContext = new ObjectContext(null, type.getFields(), timeConverter);
     }
 
     T createObject(long id, Object value) {
@@ -76,10 +73,10 @@
             return null;
         }
         if (value instanceof Object[]) {
-            return createTyped(valueDescriptors, id, (Object[]) value);
+            return createTyped(objectContext, id, (Object[]) value);
         }
         throw new InternalError("Object factory must have struct type. Type was " + value.getClass().getName());
     }
 
-    abstract T createTyped(List<ValueDescriptor> valueDescriptors, long id, Object[] values);
+    abstract T createTyped(ObjectContext objectContextm, long id, Object[] values);
 }