File path: /columba-1.4-src/core/src/main/java/org/columba/core/resourceloader/ImageLoader.java | File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/resourceloader/ResourceLoader.java | |||
Method name: ImageIcon getIcon(String, String, boolean)
|
Method name: ImageIcon getIcon(String, String, boolean)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | URL url;↵ | 1 | URL url;↵ | |
2 | if (small)↵ | 2 | if (small)↵ | |
3 | url = DiskIO.getResourceURL(path + "/16x16/" + name);↵ | 3 | url = ResourceLoader.class.getResource(path + "/16x16/" + name);↵ | |
4 | else↵ | 4 | else↵ | |
5 | url = DiskIO.getResourceURL(path + "/22x22/" + name);↵ | 5 | url = ResourceLoader.class.getResource(path + "/22x22/" + name);↵ | |
6 | if (url == null) {↵ | 6 | if (url == null)↵ | |
7 | url = getFallback(small);↵ | 7 | url = getFallback(small);↵ | |
8 | }↵ | |||
9 | ImageIcon icon = new ImageIcon(url);↵ | 8 | ImageIcon icon = new ImageIcon(url);↵ | |
10 | return icon; | 9 |
| |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
Number of mapped statements | 8 |
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) | 7.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | URL url; | 1 | URL url; | ||||||||||||
2 | if (small) | 2 | if (small) | ||||||||||||
3 | url = DiskIO.getResourceURL(path + "/16x16/" + name); |
| 3 | url = ResourceLoader.class.getResource(path + "/16x16/" + name); | |||||||||||
else | else | ||||||||||||||
4 | url = DiskIO.getResourceURL(path + "/22x22/" + name); |
| 4 | url = ResourceLoader.class.getResource(path + "/22x22/" + name); | |||||||||||
5 | if (url == null) | 5 | if (url == null) | ||||||||||||
6 | url = getFallback(small); |
| 6 | url = getFallback(small); | |||||||||||
7 | ImageIcon icon = new ImageIcon(url); | 7 | ImageIcon icon = new ImageIcon(url); | ||||||||||||
8 | return icon; | 8 | return icon; |
Row | Violation |
---|---|
1 | Expression DiskIO.getResourceURL(path + "/16x16/" + name) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression DiskIO.getResourceURL(path + "/22x22/" + name) is a method call throwing exception(s) that should be caught by a try block that will be extracted |