src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java
changeset 58480 8ca46e186a63
parent 55378 bd613b97c7c8
child 58495 465ba4fefe62
child 58679 9c3209ff7550
child 58863 c16ac7a2eba4
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java	Mon Oct 07 10:04:01 2019 -0400
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java	Mon Oct 07 16:44:12 2019 +0200
@@ -366,10 +366,16 @@
 
     public void setDestination(WriteableUserPath userSuppliedPath) throws IOException {
         synchronized (recorder) {
+            checkSetDestination(userSuppliedPath);
+            this.destination = userSuppliedPath;
+        }
+    }
+
+    public void checkSetDestination(WriteableUserPath userSuppliedPath) throws IOException {
+        synchronized (recorder) {
             if (Utils.isState(getState(), RecordingState.STOPPED, RecordingState.CLOSED)) {
                 throw new IllegalStateException("Destination can't be set on a recording that has been stopped/closed");
             }
-            this.destination = userSuppliedPath;
         }
     }