if (value == null) { pstmt.setNull(position, _colDef.getSqlType()); } else { pstmt.setDate(position, ((Date)value)); }
if (value == null) { pstmt.setNull(position, _colDef.getSqlType()); } else { pstmt.setTimestamp(position, ((Timestamp)value)); }
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/DataTypeTimestamp.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
		}
4
		else {
5
			pstmt.setDate
3
      }
4
      else {
6
(position, ((Date)value));
5
         pstmt.setTimestamp(position, ((Timestamp)value));
7
		}
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 statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)10.6
    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
    else
    3
    pstmt.setDate(position, ((Date)value));
    3
    pstmt.setDate(position, ((Date)value));
    3
    pstmt.setTimestamp(position, ((Timestamp)value));
    Differences
    Expression1Expression2Difference
    java.sql.Datejava.sql.TimestampSUBCLASS_TYPE_MISMATCH
    setDatesetTimestampMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression (Date)value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Timestamp)value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pstmt.setDate(position,((Date)value)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pstmt.setTimestamp(position,((Timestamp)value)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pstmt.setDate(position,((Date)value)) is a void method call, and thus it cannot be parameterized
    Expression pstmt.setTimestamp(position,((Timestamp)value)) is a void method call, and thus it cannot be parameterized
    3
    pstmt.setTimestamp(position, ((Timestamp)value));
    Precondition Violations (6)
    Row Violation
    1Expression (Date)value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (Timestamp)value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression pstmt.setDate(position,((Date)value)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression pstmt.setTimestamp(position,((Timestamp)value)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression pstmt.setDate(position,((Date)value)) is a void method call, and thus it cannot be parameterized
    6Expression pstmt.setTimestamp(position,((Timestamp)value)) is a void method call, and thus it cannot be parameterized