URL imgURL = FirebirdManagerPlugin.class.getResource("images/" + imageIconName); if (imgURL != null) { return new ImageIcon(imgURL); } else { log.error("Couldn't find file: images/" + imageIconName); return null; }
URL imgURL = SmarttoolsPlugin.class.getResource("images/" + imageIconName); if (imgURL != null) { return new ImageIcon(imgURL); } else { log.error("Couldn't find file: images/" + imageIconName); return null; }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/FirebirdManagerHelper.java File path: /sql12/plugins/smarttools/src/net/sourceforge/squirrel_sql/plugins/smarttools/SmarttoolsHelper.java
Method name: ImageIcon loadIcon(String) Method name: ImageIcon loadIcon(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
URL imgURL = FirebirdManagerPlugin.class.getResource("images/" + imageIconName);
1
URL imgURL = SmarttoolsPlugin.class.getResource("images/" + imageIconName);
2
        if (imgURL != null) {
2
		if (imgURL != null)
3
            
3
		{
4
return new ImageIcon(imgURL);
4
			return new ImageIcon(imgURL);
5
        } else {
6
            
5
		}
6
		else
7
		{
7
log.error("Couldn't find file: images/" + imageIconName);
8
			log.error("Couldn't find file: images/" + imageIconName);
8
            return null;
9
			return null;
9
        }
10
		}
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.1
Clones locationClones are in different classes
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    URL imgURL = FirebirdManagerPlugin.class.getResource("images/" + imageIconName);
    1
    URL imgURL = FirebirdManagerPlugin.class.getResource("images/" + imageIconName);
    1
    URL imgURL = SmarttoolsPlugin.class.getResource("images/" + imageIconName);
    Differences
    Expression1Expression2Difference
    FirebirdManagerPlugin.classSmarttoolsPlugin.classLITERAL_VALUE_MISMATCH
    1
    URL imgURL = SmarttoolsPlugin.class.getResource("images/" + imageIconName);
    2
    if (imgURL != null)
    2
    if (imgURL != null)
    3
    return new ImageIcon(imgURL);
    3
    return new ImageIcon(imgURL);
    else
    else
    4
    log.error("Couldn't find file: images/" + imageIconName);
    4
    log.error("Couldn't find file: images/" + imageIconName);
    5
    return null;
    5
    return null;
    Precondition Violations (0)
    Row Violation