--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java Wed Dec 05 09:34:01 2018 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java Wed Dec 05 16:40:12 2018 +0100
@@ -25,11 +25,11 @@
package jdk.jfr.consumer;
-import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.time.Duration;
import java.time.Instant;
+import java.time.OffsetDateTime;
import java.util.List;
import java.util.Objects;
@@ -37,7 +37,7 @@
import jdk.jfr.Timestamp;
import jdk.jfr.ValueDescriptor;
import jdk.jfr.internal.PrivateAccess;
-import jdk.jfr.internal.cmd.PrettyWriter;
+import jdk.jfr.internal.tool.PrettyWriter;
/**
* A complex data type that consists of one or more fields.
@@ -872,18 +872,19 @@
final public String toString() {
StringWriter s = new StringWriter();
PrettyWriter p = new PrettyWriter(new PrintWriter(s));
- try {
- if (this instanceof RecordedEvent) {
- p.print((RecordedEvent) this);
- } else {
- p.print(this, "");
- }
+ p.setStackDepth(5);
+ if (this instanceof RecordedEvent) {
+ p.print((RecordedEvent) this);
+ } else {
+ p.print(this, "");
+ }
+ p.flush(true);
+ return s.toString();
+ }
- } catch (IOException e) {
- // Ignore, should not happen with StringWriter
- }
- p.flush();
- return s.toString();
+ // package private for now. Used by EventWriter
+ OffsetDateTime getOffsetDateTime(String name) {
+ return OffsetDateTime.ofInstant(getInstant(name), timeConverter.getZoneOffset());
}
private static IllegalArgumentException newIllegalArgumentException(String name, String typeName) {