short data = rs.getShort(index); if (rs.wasNull()) { return null; } else { return Short.valueOf(data); }
byte data = rs.getByte(index); if (rs.wasNull()) { return null; } else { return Byte.valueOf(data); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeShort.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeByte.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
short data = rs.getShort(index);
1
byte data = rs.getByte(index);
2
		if (rs.wasNull()) {
2
		if (rs.wasNull()) {
3
			return null;
3
			return null;
4
        } else {
4
        } else {
5
            return Short.valueOf(data);
5
            return Byte.valueOf(data);
6
        }
6
        }
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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                  
    1
    byte data = rs.getByte(index);
    1
    short data = rs.getShort(index);
                                                                      
    2
    if (rs.wasNull())
    2
    if (rs.wasNull())
    3
    return null;
    3
    return null;
    else
    else
    4
    return Short.valueOf(data);
    4
    return Short.valueOf(data);
    4
    return Byte.valueOf(data);
    Differences
    Expression1Expression2Difference
    shortbyteVARIABLE_TYPE_MISMATCH
    java.lang.Shortjava.lang.ByteSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Type short of variable data does not match with type byte of variable data
    Expression Short cannot be unified with expression Byte , because common superclass java.lang.Number does not declare member(s) public static java.lang.Short valueOf(short) , public static java.lang.Byte valueOf(byte)
    4
    return Byte.valueOf(data);
    Precondition Violations (2)
    Row Violation
    1Type short of variable data does not match with type byte of variable data
    2Expression Short cannot be unified with expression Byte , because common superclass java.lang.Number does not declare member(s) public static java.lang.Short valueOf(short) , public static java.lang.Byte valueOf(byte)