File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java | |||
Method name: Object getPluginObject(IPlugin, String)
|
Method name: Object putPluginObject(IPlugin, String, Object)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | if (plugin == null)↵ | 1 | if (plugin == null)↵ | |
2 | {↵ | 2 | {↵ | |
3 | throw new IllegalArgumentException("Null IPlugin passed");↵ | 3 | throw new IllegalArgumentException("Null IPlugin passed");↵ | |
4 | }↵ | 4 | }↵ | |
5 | if (key == null)↵ | 5 | if (key == null)↵ | |
6 | {↵ | 6 | {↵ | |
7 | throw new IllegalArgumentException("Null key passed");↵ | 7 | throw new IllegalArgumentException("Null key passed");↵ | |
8 | }↵ | 8 | }↵ | |
9 | Map<String, Object> map = _pluginObjects.get(plugin.getInternalName());↵ | 9 | Map<String, Object> map = _pluginObjects.get(plugin.getInternalName());↵ | |
10 | if (map == null)↵ | 10 | if (map == null)↵ | |
11 | {↵ | 11 | {↵ | |
12 | map = new HashMap<String, Object>();↵ | 12 | map = new HashMap<String, Object>();↵ | |
13 | _pluginObjects.put(plugin.getInternalName(), map);↵ | 13 | _pluginObjects.put(plugin.getInternalName(), map);↵ | |
14 | }↵ | 14 | }↵ | |
15 | return map.get(key); | 15 | return map.put(key, value); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 40 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (plugin == null) | 1 | if (plugin == null) | ||||||||||||||||||
2 | throw new IllegalArgumentException("Null IPlugin passed"); | 2 | throw new IllegalArgumentException("Null IPlugin passed"); | ||||||||||||||||||
3 | if (key == null) | 3 | if (key == null) | ||||||||||||||||||
4 | throw new IllegalArgumentException("Null key passed"); | 4 | throw new IllegalArgumentException("Null key passed"); | ||||||||||||||||||
5 | Map<String, Object> map = _pluginObjects.get(plugin.getInternalName()); | 5 | Map<String, Object> map = _pluginObjects.get(plugin.getInternalName()); | ||||||||||||||||||
6 | if (map == null) | 6 | if (map == null) | ||||||||||||||||||
7 | map = new HashMap<String, Object>(); | 7 | map = new HashMap<String, Object>(); | ||||||||||||||||||
8 | _pluginObjects.put(plugin.getInternalName(), map); | 8 | _pluginObjects.put(plugin.getInternalName(), map); | ||||||||||||||||||
9 | return map.get(key); |
| 9 | return map.put(key, value); |
Row | Violation |
---|---|
1 | Expression map.get(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression map.put(key,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression map.get(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression map.put(key,value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |