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;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 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);
    3
    URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH + "/MISC/" + resourceName);
    Differences
    Expression1Expression2Difference
    org.columba.calendar.resourceloader.ResourceLoaderorg.columba.chat.resourceloader.ResourceLoaderVARIABLE_TYPE_MISMATCH
    ResourceLoader.classResourceLoader.classLITERAL_VALUE_MISMATCH
    Preondition Violations
    Type org.columba.calendar.resourceloader.ResourceLoader does not match with type org.columba.chat.resourceloader.ResourceLoader
    • Make classes org.columba.calendar.resourceloader.ResourceLoader and org.columba.chat.resourceloader.ResourceLoader extend a common superclass
    3
    URL url = ResourceLoader.class.getResource(ResourceLoader.ICON_PATH + "/MISC/" + resourceName);
    4
    if (url == null)
    4
    if (url == null)
    5
    url = getFallback(true);
    5
    url = getFallback(true);
    6
    ImageIcon icon = new ImageIcon(url);
    6
    ImageIcon icon = new ImageIcon(url);
    7
    return icon;
    7
    return icon;
    Precondition Violations (1)
    Row Violation
    1Type org.columba.calendar.resourceloader.ResourceLoader does not match with type org.columba.chat.resourceloader.ResourceLoader