@@ -111,7 +111,7 @@ public Void run() {
111
111
private static final String OPTION_DUMP_ON_EXIT = "dumpOnExit" ;
112
112
private static final String OPTION_DURATION = "duration" ;
113
113
private static final String OPTION_DESTINATION = "destination" ;
114
- private static final List <String > OPTIONS = Arrays .asList (new String [] { OPTION_DUMP_ON_EXIT , OPTION_DURATION , OPTION_NAME , OPTION_MAX_AGE , OPTION_MAX_SIZE , OPTION_DISK , OPTION_DESTINATION , } );
114
+ private static final List <String > OPTIONS = Arrays .asList (OPTION_DUMP_ON_EXIT , OPTION_DURATION , OPTION_NAME , OPTION_MAX_AGE , OPTION_MAX_SIZE , OPTION_DISK , OPTION_DESTINATION );
115
115
private final StreamManager streamHandler = new StreamManager ();
116
116
private final Map <Long , Object > changes = new ConcurrentHashMap <>();
117
117
private final AtomicLong sequenceNumber = new AtomicLong ();
@@ -282,6 +282,7 @@ public void setRecordingOptions(long recording, Map<String, String> options) thr
282
282
for (Map .Entry <String , String > entry : ops .entrySet ()) {
283
283
Object key = entry .getKey ();
284
284
Object value = entry .getValue ();
285
+ // Keys and values may be sent over the network
285
286
if (!(key instanceof String )) {
286
287
throw new IllegalArgumentException ("Option key must not be null, or other type than " + String .class );
287
288
}
@@ -302,13 +303,13 @@ public void setRecordingOptions(long recording, Map<String, String> options) thr
302
303
validateOption (ops , OPTION_DURATION , MBeanUtils ::duration );
303
304
validateOption (ops , OPTION_DESTINATION , x -> MBeanUtils .destination (r , x ));
304
305
305
- // All OK, now set them.atomically
306
- setOption (ops , OPTION_DUMP_ON_EXIT , "false" , MBeanUtils ::booleanValue , x -> r . setDumpOnExit ( x ) );
307
- setOption (ops , OPTION_DISK , "true" , MBeanUtils ::booleanValue , x -> r . setToDisk ( x ) );
308
- setOption (ops , OPTION_NAME , String .valueOf (r .getId ()), Function .identity (), x -> r . setName ( x ) );
309
- setOption (ops , OPTION_MAX_AGE , null , MBeanUtils ::duration , x -> r . setMaxAge ( x ) );
310
- setOption (ops , OPTION_MAX_SIZE , "0" , MBeanUtils ::size , x -> r . setMaxSize ( x ) );
311
- setOption (ops , OPTION_DURATION , null , MBeanUtils ::duration , x -> r . setDuration ( x ) );
306
+ // All OK, now set them
307
+ setOption (ops , OPTION_DUMP_ON_EXIT , "false" , MBeanUtils ::booleanValue , r :: setDumpOnExit );
308
+ setOption (ops , OPTION_DISK , "true" , MBeanUtils ::booleanValue , r :: setToDisk );
309
+ setOption (ops , OPTION_NAME , String .valueOf (r .getId ()), Function .identity (), r :: setName );
310
+ setOption (ops , OPTION_MAX_AGE , null , MBeanUtils ::duration , r :: setMaxAge );
311
+ setOption (ops , OPTION_MAX_SIZE , "0" , MBeanUtils ::size , r :: setMaxSize );
312
+ setOption (ops , OPTION_DURATION , null , MBeanUtils ::duration , r :: setDuration );
312
313
setOption (ops , OPTION_DESTINATION , null , x -> MBeanUtils .destination (r , x ), x -> setOptionDestination (r , x ));
313
314
}
314
315
0 commit comments