if (_conn != null) { return _conn.getSQLMetaData(); } else { return null; }
if (_currentRow != null) { return _currentRow[columnIndex]; } else { return null; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/ResultSetDataSet.java
Method name: ISQLDatabaseMetaData getMetaData() Method name: Object get(int)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (_conn != null) {
1
if (_currentRow != null) {
2
            return _conn.getSQLMetaData();
2
         return _currentRow[columnIndex];
3
        } else {
3
      } else {
4
            return null;
4
         return null;
5
        }
5
      }
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.2
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 fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_conn != null)
    1
    if (_conn != null)
    1
    if (_currentRow != null)
    Differences
    Expression1Expression2Difference
    _conn_currentRowVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.SQLConnectionjava.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable _conn does not match with type java.lang.Object[] of variable _currentRow
    • Make classes net.sourceforge.squirrel_sql.fw.sql.SQLConnection and java.lang.Object[] extend a common superclass
    1
    if (_currentRow != null)
                                                                          
    2
    return _currentRow[columnIndex];
    Preondition Violations
    Unmatched statement return _currentRow[columnIndex]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return _currentRow[columnIndex];
    2
    return _currentRow[columnIndex];
    2
    return _conn.getSQLMetaData();
    2
    return _conn.getSQLMetaData();
    Preondition Violations
    Unmatched statement return _conn.getSQLMetaData(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return _conn.getSQLMetaData();
                                                                      
    else
    else
    3
    return null;
    3
    return null;
    Precondition Violations (7)
    Row Violation
    1Type net.sourceforge.squirrel_sql.fw.sql.SQLConnection of variable _conn does not match with type java.lang.Object[] of variable _currentRow
    2Unmatched statement return _currentRow[columnIndex]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return _currentRow[columnIndex];
    4Unmatched statement return _conn.getSQLMetaData(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return _conn.getSQLMetaData();
    6Not all possible execution flows end in a return statement
    7The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.Session and net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet do not have a common superclass