File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/jdk.jfr/share/classes/jdk/jfr Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ public Map<String, String> toMap() {
9999 * A newly created recording is in the {@link RecordingState#NEW} state. To start
100100 * the recording, invoke the {@link Recording#start()} method.
101101 *
102+ * @param settings settings as a map of name-value pairs, not {@code null}
103+ *
102104 * @throws IllegalStateException if Flight Recorder can't be created (for
103105 * example, if the Java Virtual Machine (JVM) lacks Flight Recorder
104106 * support, or if the file repository can't be created or accessed)
@@ -109,9 +111,11 @@ public Map<String, String> toMap() {
109111 * @see jdk.jfr
110112 */
111113 public Recording (Map <String , String > settings ) {
114+ Objects .requireNonNull (settings );
115+ Map <String , String > sanitized = Utils .sanitizeNullFreeStringMap (settings );
112116 PlatformRecorder r = FlightRecorder .getFlightRecorder ().getInternal ();
113117 synchronized (r ) {
114- this .internal = r .newRecording (settings );
118+ this .internal = r .newRecording (sanitized );
115119 this .internal .setRecording (this );
116120 if (internal .getRecording () != this ) {
117121 throw new InternalError ("Internal recording not properly setup" );
You can’t perform that action at this time.
0 commit comments