for (int i = 0, limit = files.size(); i < limit; ++i) { if (!(files.get(i)).delete()) { //i18n[DumpApplicationCommand.error.deletetempfile=Couldn't delete temporary DumpSession file] s_log.error(s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile")); } }
for (int i = 0, limit = files.size(); i < limit; ++i) { if (!(files.get(i)).delete()) { s_log.error("Couldn't delete temporary DumpSession file"); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/mainframe/action/DumpApplicationCommand.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/DumpSessionCommand.java
Method name: void deleteTempFiles(List) Method name: void deleteTempFiles(List)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0, limit = files.size(); i < limit; ++i)
1
for (int i = 0, limit = files.size(); i < limit; ++i)
2
		{
2
		{
3
			if (!(files.get(i)).delete())
3
			if (!(files.get(i)).delete())
4
			{
4
			{
5
                //i18n[DumpApplicationCommand.error.deletetempfile=Couldn't delete temporary DumpSession file]
6
				s_log.error(s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile"));
5
				s_log.error("Couldn't delete temporary DumpSession file");
7
			}
6
			}
8
		}
7
		}
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.5
Clones locationClones are in different classes
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0, limit = files.size(); i < limit; ++i)
    1
    for (int i = 0, limit = files.size(); i < limit; ++i)
    2
    if (!(files.get(i)).delete())
    2
    if (!(files.get(i)).delete())
    3
    s_log.error(s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile"));
    3
    s_log.error(s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile"));
    3
    s_log.error("Couldn't delete temporary DumpSession file");
    Differences
    Expression1Expression2Difference
    s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile")"Couldn't delete temporary DumpSession file"TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile") is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3
    s_log.error("Couldn't delete temporary DumpSession file");
    Precondition Violations (1)
    Row Violation
    1Expression s_stringMgr.getString("DumpApplicationCommand.error.deletetempfile") is a method call throwing exception(s) that should be caught by a try block that will be extracted