if (value == null) { pstmt.setNull(position, _colDef.getSqlType()); } else { pstmt.setDate(position, ((Date)value)); }
if (value == null) { pstmt.setNull(position, _colDef.getSqlType()); } else { pstmt.setLong(position, ((Long)value).longValue()); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeDate.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeLong.java
Method name: void setPreparedStatementValue(PreparedStatement, Object, int) Method name: void setPreparedStatementValue(PreparedStatement, Object, int)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (value == null) {
1
if (value == null) {
2
			pstmt.setNull(position, _colDef.getSqlType());
2
			pstmt.setNull(position, _colDef.getSqlType());
3
		}
3
		}
4
		else {
4
		else {
5
			pstmt.setDate(position, ((Date)value));
5
			pstmt.setLong(position, ((Long)value).longValue());
6
		}
6
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {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)10.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (value == null)
    1
    if (value == null)
    2
    pstmt.setNull(position, _colDef.getSqlType());
    2
    pstmt.setNull(position, _colDef.getSqlType());
    else
            
                                                                                                              
    3
    pstmt.setLong(position, ((Long)value).longValue());
    Preondition Violations
    Unmatched statement pstmt.setLong(position,((Long)value).longValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement pstmt.setLong(position,((Long)value).longValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3
    pstmt.setLong(position, ((Long)value).longValue());
    3
    pstmt.setDate(position, ((Date)value));
    3
    pstmt.setDate(position, ((Date)value));
    Preondition Violations
    Unmatched statement pstmt.setDate(position,((Date)value)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement pstmt.setDate(position,((Date)value)); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                      
    Precondition Violations (4)
    Row Violation
    1Unmatched statement pstmt.setLong(position,((Long)value).longValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement pstmt.setLong(position,((Long)value).longValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched statement pstmt.setDate(position,((Date)value)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement pstmt.setDate(position,((Date)value)); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted