Skip to content

Commit

Permalink
8278262: JFR: TestPrintXML can't handle missing timestamps
Browse files Browse the repository at this point in the history
Reviewed-by: mgronlun
  • Loading branch information
egahlin committed May 12, 2022
1 parent 74eee28 commit 7118343
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/jdk/jdk/jfr/tool/TestPrintXML.java
Expand Up @@ -138,9 +138,13 @@ static boolean compare(Object eventObject, Object xmlObject) {
Object xmlValue = xmlMap.get(name);
Object expectedValue = re.getValue(name);
if (v.getAnnotation(Timestamp.class) != null) {
// Make instant of OffsetDateTime
xmlValue = OffsetDateTime.parse("" + xmlValue).toInstant().toString();
expectedValue = re.getInstant(name);
if (expectedValue.equals(Long.MIN_VALUE)) { // Missing
expectedValue = OffsetDateTime.MIN;
} else {
// Make instant of OffsetDateTime
xmlValue = OffsetDateTime.parse("" + xmlValue).toInstant().toString();
expectedValue = re.getInstant(name);
}
}
if (v.getAnnotation(Timespan.class) != null) {
expectedValue = re.getDuration(name);
Expand Down

1 comment on commit 7118343

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.