File tree 3 files changed +10
-173
lines changed
main/java/com/navercorp/pinpoint/profiler
test/java/com/navercorp/pinpoint/profiler/util
3 files changed +10
-173
lines changed Original file line number Diff line number Diff line change 16
16
package com .navercorp .pinpoint .profiler .context .scope ;
17
17
18
18
import com .navercorp .pinpoint .bootstrap .context .scope .TraceScope ;
19
- import com .navercorp .pinpoint .profiler .util .NameValueList ;
19
+
20
+ import java .util .HashMap ;
21
+ import java .util .Map ;
22
+ import java .util .Objects ;
20
23
21
24
/**
22
25
* @author jaehong.kim
23
26
*/
24
27
public class DefaultTraceScopePool {
25
28
26
- private final NameValueList < TraceScope > list = new NameValueList <>();
29
+ private final Map < String , TraceScope > map = new HashMap <>();
27
30
28
31
public TraceScope get (String name ) {
29
- if (name == null ) {
30
- throw new IllegalArgumentException ("name" );
31
- }
32
+ Objects .requireNonNull (name , "name" );
32
33
33
- return list .get (name );
34
+ return map .get (name );
34
35
}
35
36
36
37
public TraceScope add (String name ) {
37
- if (name == null ) {
38
- throw new IllegalArgumentException ("name" );
39
- }
38
+ Objects .requireNonNull (name , "name" );
40
39
41
- final TraceScope oldScope = list .add (name , new DefaultTraceScope (name ));
42
- return oldScope ;
40
+ return map .put (name , new DefaultTraceScope (name ));
43
41
}
44
42
45
43
public void clear () {
46
- list .clear ();
44
+ map .clear ();
47
45
}
48
46
}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments