-
Enhancement
-
Resolution: Fixed
-
P3
-
16
-
b28
The method RecordedEvent:getField(String) allows a user to get a field for an event type, for example eventType.getField("monitorClass").
The value of an event can be obtained by invoking event.getValue("monitorClass"), but it's also possible to index into a nested value by using ".", for example getValue("monitorClass.modifiers"). The latter can't be done when using getField(String). It is inconsistent and inconvenient as it to forces users to traverse the fields manually:
for (ValueDescriptor v : eventType.getField("monitorClass").getFields()) {
if ("modifiers".equals(v.getName()) {
return v;
}
}
instead of doing getField("monitorClass.modifiers")
The value of an event can be obtained by invoking event.getValue("monitorClass"), but it's also possible to index into a nested value by using ".", for example getValue("monitorClass.modifiers"). The latter can't be done when using getField(String). It is inconsistent and inconvenient as it to forces users to traverse the fields manually:
for (ValueDescriptor v : eventType.getField("monitorClass").getFields()) {
if ("modifiers".equals(v.getName()) {
return v;
}
}
instead of doing getField("monitorClass.modifiers")
- csr for
-
JDK-8257818 JFR: getField(String) should be able to access nested fields
- Closed