if(_escapes[i].productMatches(md)) { return _escapes[i].escapeSQL(sql); }
for (int i = 0; i < _booleans.length; i++) { if(_booleans[i].productMatches(md)) { return _booleans[i].getBooleanValue(orig); } }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DatabaseSpecificEscape.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DatabaseSpecificBooleanValue.java
Method name: String escapeSQL(String, ISQLDatabaseMetaData) Method name: String getBooleanValue(String, ISQLDatabaseMetaData)
Number of AST nodes: 2 Number of AST nodes: 3
1
if(_escape
1
for (int i = 0; i < _booleans.length; i++) {
2
s[i].productMatches(md))
2
            if(_booleans[i].productMatches(md))
3
    
3
 {
4
     {
4
    
5
            return _escapes[i].escapeSQL(sql);
5
            return _
6
 
6
booleans[i].getBooleanValue(orig);
7
            }
7
        }
8
        }
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (_escapes[i].productMatches(md))
    2
    if (_escapes[i].productMatches(md))
    2
    if (_booleans[i].productMatches(md))
    Differences
    Expression1Expression2Difference
    _escapes_booleansVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificEscape.IEscape[]net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificBooleanValue.IBooleanValue[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificEscape.IEscape[] of variable _escapes does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificBooleanValue.IBooleanValue[] of variable _booleans
    • Make classes net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificEscape.IEscape[] and net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificBooleanValue.IBooleanValue[] extend a common superclass
    2
    if (_booleans[i].productMatches(md))
                                                                                              
    3
    return _booleans[i].getBooleanValue(orig);
    Preondition Violations
    Unmatched statement return _booleans[i].getBooleanValue(orig); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return _booleans[i].getBooleanValue(orig);
    3
    return _booleans[i].getBooleanValue(orig);
    3
    return _escapes[i].escapeSQL(sql);
    3
    return _escapes[i].escapeSQL(sql);
    Preondition Violations
    Unmatched statement return _escapes[i].escapeSQL(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return _escapes[i].escapeSQL(sql);
                                                                              
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificEscape.IEscape[] of variable _escapes does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DatabaseSpecificBooleanValue.IBooleanValue[] of variable _booleans
    2Unmatched statement return _booleans[i].getBooleanValue(orig); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return _booleans[i].getBooleanValue(orig);
    4Unmatched statement return _escapes[i].escapeSQL(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return _escapes[i].escapeSQL(sql);
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero