Skip to content

Commit 09707dd

Browse files
committed
8252807: The jdk.jfr.Recording.getStream does not work when toDisk is disabled
Reviewed-by: mgronlun
1 parent 04ce8e3 commit 09707dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jdk.jfr/share/classes/jdk/jfr/Recording.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ public void setToDisk(boolean disk) {
577577
* Creates a data stream for a specified interval.
578578
* <p>
579579
* The stream may contain some data outside the specified range.
580+
* <p>
581+
* If the recording is not to disk, a stream can't be created
582+
* and {@code null} is returned.
580583
*
581584
* @param start the start time for the stream, or {@code null} to get data from
582585
* start time of the recording
@@ -585,12 +588,14 @@ public void setToDisk(boolean disk) {
585588
* present time.
586589
*
587590
* @return an input stream, or {@code null} if no data is available in the
588-
* interval.
591+
* interval, or the recording was not recorded to disk
589592
*
590593
* @throws IllegalArgumentException if {@code end} happens before
591594
* {@code start}
592595
*
593596
* @throws IOException if a stream can't be opened
597+
*
598+
* @see #setToDisk(boolean)
594599
*/
595600
public InputStream getStream(Instant start, Instant end) throws IOException {
596601
if (start != null && end != null && end.isBefore(start)) {

0 commit comments

Comments
 (0)