String columnValue = rs.getString(col); if (columnValue != null) { columnValue = columnValue.trim(); } if (first) { first = false; } else { line.append(","); } line.append(columnValue);
if (systemid != null) { String url = systemid; if (url.startsWith("file:")) { url = FileUtils.getFileUtils().fromURI(url); } msg.append(url); } else { msg.append("Unknown file"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/SQLExec.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
Method name: void printResults(ResultSet, PrintStream) Method name: void logError(TransformerException, String)
Number of AST nodes: 7 Number of AST nodes: 6
1
String columnValue = rs.getString(col);
2
                    if (columnValue != null) {
3
                        columnValue = columnValue.trim();
4
                    }
5
                    if (first) {
6
                        first = false
1
if (systemid != null) {
2
                String url = systemid;
3
                if (url.startsWith("file:")) {
7
;
4
                    url = FileUtils.getFileUtils().fromURI(url);
8
                    } else {
5
                }
9
                        line.append(",");
6
                msg.append(url);
10
                    }
7
            
11
    
8
} else {
12
                line.append(columnValue);
9
                msg.append("Unknown file");
10
            }
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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    16
    String columnValue = rs.getString(col);
    16
    String columnValue = rs.getString(col);
    8
    String url = systemid;
    Differences
    Expression1Expression2Difference
    columnValueurlVARIABLE_NAME_MISMATCH
    rs.getString(col)systemidTYPE_COMPATIBLE_REPLACEMENT
    8
    String url = systemid;
    17
    if (columnValue != null)
    17
    if (columnValue != null)
    Preondition Violations
    Unmatched statement if(columnValue != null) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                          
    18
    columnValue = columnValue.trim();
    18
    columnValue = columnValue.trim();
    Preondition Violations
    Unmatched statement columnValue=columnValue.trim(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                          
    19
    if (first)
    19
    if (first)
    9
    if (url.startsWith("file:"))
    Differences
    Expression1Expression2Difference
    firsturl.startsWith("file:")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression url.startsWith("file:") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    if (url.startsWith("file:"))
                                                                                                
    10
    url = FileUtils.getFileUtils().fromURI(url);
    20
    first = false;
    20
    first = false;
    Preondition Violations
    Unmatched statement first=false; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                    
    else
            
    21
    line.append(",");
                                              
    Precondition Violations (4)
    Row Violation
    1Unmatched statement if(columnValue != null) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement columnValue=columnValue.trim(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression url.startsWith("file:") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched statement first=false; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted