if (value == null) { pstmt.setNull(position, _colDef.getSqlType()); } else { pstmt.setString(position, ((String)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/DataTypeOther.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.setString
3
      }
4
      else {
6
(position, ((String)value));
5
         pstmt.setTimestamp(position, ((Timestamp)value));
7
		}
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 comparisons9
  1. {Non-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.3
    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.setString(position, ((String)value));
    3
    pstmt.setString(position, ((String)value));
    3
    pstmt.setTimestamp(position, ((Timestamp)value));
    Differences
    Expression1Expression2Difference
    java.lang.Stringjava.sql.TimestampVARIABLE_TYPE_MISMATCH
    setStringsetTimestampMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression (String)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
    Type java.lang.String does not match with type java.sql.Timestamp
    • Make classes java.lang.String and java.sql.Timestamp extend a common superclass
    Expression pstmt.setString(position,((String)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.setString(position,((String)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 (7)
    Row Violation
    1Expression (String)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
    3Type java.lang.String does not match with type java.sql.Timestamp
    4Expression pstmt.setString(position,((String)value)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression pstmt.setTimestamp(position,((Timestamp)value)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression pstmt.setString(position,((String)value)) is a void method call, and thus it cannot be parameterized
    7Expression pstmt.setTimestamp(position,((Timestamp)value)) is a void method call, and thus it cannot be parameterized