float data = rs.getFloat(index); if (rs.wasNull()) return null; else return new Float(data);
double data = rs.getDouble(index); if (rs.wasNull()) return null; else return new Double(data);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeFloat.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeDouble.java
Method name: Object readResultSet(ResultSet, int, boolean) Method name: Object readResultSet(ResultSet, int, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
float data = rs.getFloat(index);
1
double data = rs.getDouble(index);
2
      if (rs.wasNull())
2
      if (rs.wasNull())
3
         return null;
3
         return null;
4
      else return new Float(data);
4
      else return new Double(data);
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 having the same super class
Number of node comparisons10
  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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                          
    1
    double data = rs.getDouble(index);
    1
    float data = rs.getFloat(index);
                                                                      
    2
    if (rs.wasNull())
    2
    if (rs.wasNull())
    3
    return null;
    3
    return null;
    else
    else
    4
    return new Float(data);
    4
    return new Float(data);
    4
    return new Double(data);
    Differences
    Expression1Expression2Difference
    java.lang.Floatjava.lang.DoubleSUBCLASS_TYPE_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression new Float(data) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Double(data) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type float of variable data does not match with type double of variable data
    4
    return new Double(data);
    Precondition Violations (3)
    Row Violation
    1Expression new Float(data) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Double(data) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type float of variable data does not match with type double of variable data