8239585: JFR: Native events should support empty payloads

Reviewed-by: mgronlun
This commit is contained in:
Erik Gahlin 2020-02-24 17:10:01 +01:00
parent bb7344d919
commit 266446f316
2 changed files with 7 additions and 1 deletions

View File

@ -636,6 +636,12 @@ public class GenerateJfrFiles {
}
out.write(" }");
}
// Avoid clash with static commit() method
if (event.fields.isEmpty()) {
return;
}
out.write("");
StringJoiner sj = new StringJoiner(",\n ");
if (event.startTime) {

View File

@ -45,7 +45,7 @@
<xs:element maxOccurs="unbounded" name="Event">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Field">
<xs:element minOccurs="0" maxOccurs="unbounded" name="Field">
<xs:complexType>
<xs:attribute name="type" type="xs:NMTOKEN" use="required" />
<xs:attribute name="struct" type="xs:boolean" use="optional" />