1
1
/*
2
- * Copyright (c) 2016, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2016, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@ public final class RecordingInfo {
51
51
private final String state ;
52
52
private final boolean dumpOnExit ;
53
53
private final long size ;
54
- private final boolean disk ;
54
+ private final boolean toDisk ;
55
55
private final long maxAge ;
56
56
private final long maxSize ;
57
57
private final long startTime ;
@@ -67,7 +67,7 @@ public final class RecordingInfo {
67
67
state = recording .getState ().toString ();
68
68
dumpOnExit = recording .getDumpOnExit ();
69
69
size = recording .getSize ();
70
- disk = recording .isToDisk ();
70
+ toDisk = recording .isToDisk ();
71
71
72
72
Duration d = recording .getMaxAge ();
73
73
if (d == null ) {
@@ -87,12 +87,17 @@ public final class RecordingInfo {
87
87
}
88
88
89
89
private RecordingInfo (CompositeData cd ) {
90
- id = (int ) cd .get ("id" );
90
+ id = (long ) cd .get ("id" );
91
91
name = (String ) cd .get ("name" );
92
92
state = (String ) cd .get ("state" );
93
93
dumpOnExit = (boolean ) cd .get ("dumpOnExit" );
94
94
size = (long ) cd .get ("size" );
95
- disk = (boolean ) cd .get ("disk" );
95
+ if (cd .containsKey ("toDisk" )){
96
+ toDisk = (boolean ) cd .get ("toDisk" );
97
+ } else {
98
+ // Before JDK-8219904 was fixed, the element name was disk, so for compatibility
99
+ toDisk = (boolean ) cd .get ("disk" );
100
+ }
96
101
maxAge = (Long ) cd .get ("maxAge" );
97
102
maxSize = (Long ) cd .get ("maxSize" );
98
103
startTime = (Long ) cd .get ("startTime" );
@@ -290,7 +295,7 @@ public long getSize() {
290
295
* @return {@code true} if recording is to disk, {@code false} otherwise
291
296
*/
292
297
public boolean isToDisk () {
293
- return disk ;
298
+ return toDisk ;
294
299
}
295
300
296
301
/**
@@ -342,7 +347,7 @@ public long getDuration() {
342
347
* <td>{@code Long}</td>
343
348
* </tr>
344
349
* <tr>
345
- * <th scope="row">disk </th>
350
+ * <th scope="row">toDisk </th>
346
351
* <td>{@code Boolean}</td>
347
352
* </tr>
348
353
* <tr>
0 commit comments