URL url; if (small) url = DiskIO.getResourceURL(path + "/16x16/" + name); else url = DiskIO.getResourceURL(path + "/22x22/" + name); if (url == null) { url = getFallback(small); } ImageIcon icon = new ImageIcon(url); return icon;
URL url; if (small) url = ResourceLoader.class.getResource(path + "/16x16/" + name); else url = ResourceLoader.class.getResource(path + "/22x22/" + name); if (url == null) url = getFallback(small); ImageIcon icon = new ImageIcon(url); return icon;
Clone fragments detected by clone detection tool
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
		return icon;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.0
    Clone typeType 2
    Mapped Statements
    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 = DiskIO.getResourceURL(path + "/16x16/" + name);
    3
    url = ResourceLoader.class.getResource(path + "/16x16/" + name);
    Differences
    Expression1Expression2Difference
    DiskIO.getResourceURL(path + "/16x16/" + name)ResourceLoader.class.getResource(path + "/16x16/" + name)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    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
    3
    url = ResourceLoader.class.getResource(path + "/16x16/" + name);
    else
    else
    4
    url = DiskIO.getResourceURL(path + "/22x22/" + name);
    4
    url = DiskIO.getResourceURL(path + "/22x22/" + name);
    4
    url = ResourceLoader.class.getResource(path + "/22x22/" + name);
    Differences
    Expression1Expression2Difference
    DiskIO.getResourceURL(path + "/22x22/" + name)ResourceLoader.class.getResource(path + "/22x22/" + name)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    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
    4
    url = ResourceLoader.class.getResource(path + "/22x22/" + name);
    5
    if (url == null)
    5
    if (url == null)
    6
    url = getFallback(small);
    6
    url = getFallback(small);
    6
    url = getFallback(small);
    Differences
    Expression1Expression2Difference
    getFallbackgetFallbackMETHOD_INVOCATION_NAME_MISMATCH
    6
    url = getFallback(small);
    7
    ImageIcon icon = new ImageIcon(url);
    7
    ImageIcon icon = new ImageIcon(url);
    8
    return icon;
    8
    return icon;
    Precondition Violations (2)
    Row Violation
    1Expression DiskIO.getResourceURL(path + "/16x16/" + name) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression DiskIO.getResourceURL(path + "/22x22/" + name) is a method call throwing exception(s) that should be caught by a try block that will be extracted