1
1
/*
2
- * Copyright (c) 2020, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2020, 2023 , 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
@@ -109,8 +109,8 @@ static final class RemoteSettings implements EventSettingsModifier {
109
109
110
110
@ Override
111
111
public void with (String name , String value ) {
112
- Objects .requireNonNull (name );
113
- Objects .requireNonNull (value );
112
+ Objects .requireNonNull (name , "name" );
113
+ Objects .requireNonNull (value , "value" );
114
114
// FlightRecorderMXBean implementation always returns
115
115
// new instance of Map so no need to create new here.
116
116
Map <String , String > newSettings = getEventSettings ();
@@ -210,12 +210,12 @@ public RemoteRecordingStream(MBeanServerConnection connection, Path directory) t
210
210
}
211
211
212
212
@ SuppressWarnings ("removal" )
213
- private RemoteRecordingStream (MBeanServerConnection connection , Path dir , boolean delete ) throws IOException {
214
- Objects .requireNonNull (connection );
215
- Objects .requireNonNull (dir );
213
+ private RemoteRecordingStream (MBeanServerConnection connection , Path directory , boolean delete ) throws IOException {
214
+ Objects .requireNonNull (connection , "connection" );
215
+ Objects .requireNonNull (directory , "directory" );
216
216
accessControllerContext = AccessController .getContext ();
217
217
// Make sure users can't implement malicious version of a Path object.
218
- path = Paths .get (dir .toString ());
218
+ path = Paths .get (directory .toString ());
219
219
if (!Files .exists (path )) {
220
220
throw new IOException ("Download directory doesn't exist" );
221
221
}
@@ -334,7 +334,7 @@ private long createRecording() throws IOException {
334
334
* @see Recording#setSettings(Map)
335
335
*/
336
336
public void setSettings (Map <String , String > settings ) {
337
- Objects .requireNonNull (settings );
337
+ Objects .requireNonNull (settings , "settings" );
338
338
try {
339
339
mbean .setRecordingSettings (recordingId , settings );
340
340
} catch (Exception e ) {
@@ -355,7 +355,7 @@ public void setSettings(Map<String, String> settings) {
355
355
*
356
356
*/
357
357
public EventSettings disable (String name ) {
358
- Objects .requireNonNull (name );
358
+ Objects .requireNonNull (name , "name" );
359
359
EventSettings s = ManagementSupport .newEventSettings (new RemoteSettings (mbean , recordingId ));
360
360
try {
361
361
return s .with (name + "#" + ENABLED , "false" );
@@ -379,7 +379,7 @@ public EventSettings disable(String name) {
379
379
* @see EventType
380
380
*/
381
381
public EventSettings enable (String name ) {
382
- Objects .requireNonNull (name );
382
+ Objects .requireNonNull (name , "name" );
383
383
EventSettings s = ManagementSupport .newEventSettings (new RemoteSettings (mbean , recordingId ));
384
384
try {
385
385
return s .with (name + "#" + ENABLED , "true" );
@@ -656,7 +656,7 @@ private void ensureStartable() {
656
656
* @since 17
657
657
*/
658
658
public void dump (Path destination ) throws IOException {
659
- Objects .requireNonNull (destination );
659
+ Objects .requireNonNull (destination , "destination" );
660
660
long id = -1 ;
661
661
try {
662
662
FileDump fileDump ;
0 commit comments