From 266446f316534dd19323f2e74395f10c6eb86e1a Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Mon, 24 Feb 2020 17:10:01 +0100 Subject: [PATCH] 8239585: JFR: Native events should support empty payloads Reviewed-by: mgronlun --- make/src/classes/build/tools/jfr/GenerateJfrFiles.java | 6 ++++++ src/hotspot/share/jfr/metadata/metadata.xsd | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/make/src/classes/build/tools/jfr/GenerateJfrFiles.java b/make/src/classes/build/tools/jfr/GenerateJfrFiles.java index 544336007e0..f90dc2b7e5b 100644 --- a/make/src/classes/build/tools/jfr/GenerateJfrFiles.java +++ b/make/src/classes/build/tools/jfr/GenerateJfrFiles.java @@ -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) { diff --git a/src/hotspot/share/jfr/metadata/metadata.xsd b/src/hotspot/share/jfr/metadata/metadata.xsd index 979dbf10998..bded74ce2e5 100644 --- a/src/hotspot/share/jfr/metadata/metadata.xsd +++ b/src/hotspot/share/jfr/metadata/metadata.xsd @@ -45,7 +45,7 @@ - +