if (resourceName == null)
throw new IllegalArgumentException("resourceName == null");
URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH
+ "/MISC/" + resourceName);
if (url == null)
url = getFallback(true);
ImageIcon icon = new ImageIcon(url);
return icon;
if (resourceName == null)
throw new IllegalArgumentException("resourceName == null");
URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH + "/MISC/"
+ resourceName);
if (url == null)
url = getFallback(true);
ImageIcon icon = new ImageIcon(url);
return icon;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/resourceloader/ResourceLoader.java
|
|
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/resourceloader/ResourceLoader.java
|
Method name: ImageIcon getMiscIcon(String)
|
|
Method name: ImageIcon getMiscIcon(String)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (resourceName == null)↵ | | 1 | if (resourceName == null)↵
|
2 | throw new IllegalArgumentException("resourceName == null");↵ | | 2 | throw new IllegalArgumentException("resourceName == null");↵
|
|
3 | URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH↵ | | 3 | URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH↵
|
4 | + "/MISC/" ↵ | | 4 | + "/MISC/"↵
|
5 | + resourceName);↵ | | 5 | + resourceName);↵
|
|
6 | if (url == null)↵ | | 6 | if (url == null)↵
|
7 | url = getFallback(true);↵ | | 7 | url = getFallback(true);↵
|
|
8 | ImageIcon icon = new ImageIcon(url);↵ | | 8 | ImageIcon icon = new ImageIcon(url);↵
|
|
9 | return icon; | | 9 | return icon;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 18 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 2.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (resourceName == null) | | 1 | if (resourceName == null) |
2 | throw new IllegalArgumentException("resourceName == null"); | | 2 | throw new IllegalArgumentException("resourceName == null"); |
3 | URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH + "/MISC/" + resourceName); | | 3 | URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH + "/MISC/" + resourceName); |
4 | if (url == null) | | 4 | if (url == null) |
5 | | | 5 | |
6 | ImageIcon icon = new ImageIcon(url); | | 6 | ImageIcon icon = new ImageIcon(url); |
7 | return icon; | | 7 | return icon; |
Precondition Violations (1)
Row |
Violation |
1 | Type org.columba.calendar.resourceloader.ResourceLoader does not match with type org.columba.chat.resourceloader.ResourceLoader |