for (int i = 0; i < _escapes.length; i++) { if(_escapes[i].productMatches(md)) { return _escapes[i].escapeSQL(sql); } } return sql;
for (int i = 0; i < _booleans.length; i++) { if(_booleans[i].productMatches(md)) { return _booleans[i].getBooleanValue(orig); } } return 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: 4 Number of AST nodes: 4
1
for (int i = 0; i < _escapes.length; i++)
1
for (int i = 0; i < _booleans.length; i++) {
2
      {
2
   
3
         if(_escapes[i].productMatches(md))
3
         if(_booleans[i].productMatches(md)) {
4
         {
4
      
5
            return _escapes[i].escapeSQL(sql);
5
          return _booleans[i].getBooleanValue(orig);
6
         }
6
         
7
   }
7
      }
8
        }
8
      return sql;
9
        return orig;
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.4
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < _escapes.length; i++)
    1
    for (int i = 0; i < _escapes.length; i++)
    1
    for (int i = 0; i < _booleans.length; i++)
    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 int of variable _escapes.length does not match with type int of variable _booleans.length
    • 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
    1
    for (int i = 0; i < _booleans.length; i++)
    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 or after the extracted code, because it has dependencies to/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 or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return _escapes[i].escapeSQL(sql);
                                                                              
    4
    return sql;
    4
    return sql;
    4
    return orig;
    Differences
    Expression1Expression2Difference
    sqlorigVARIABLE_NAME_MISMATCH
    4
    return orig;
    Precondition Violations (6)
    Row Violation
    1Type int of variable _escapes.length does not match with type int of variable _booleans.length
    2Type 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
    3Unmatched statement return _booleans[i].getBooleanValue(orig); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return _booleans[i].getBooleanValue(orig);
    5Unmatched statement return _escapes[i].escapeSQL(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return _escapes[i].escapeSQL(sql);