try {
if (value == null) {
pstmt.setNull(position, _colDef.getSqlType(), _colDef
.getSqlTypeName());
} else {
pstmt.setString(position, value.toString());
}
} catch (Exception e) {
s_log.error("setPreparedStatementValue: Unexpected exception - "
+ e.getMessage(), e);
}
if (value == null)
{
pstmt.setNull(position, java.sql.Types.OTHER, typeName);
} else
{
try
{
pstmt.setString(position, value.toString());
} catch (Exception e)
{
s_log.error("setPreparedStatementValue: Unexpected exception - " + e.getMessage(), e);
}
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/db2/src/net/sourceforge/squirrel_sql/plugins/db2/types/DB2XmlTypeDataTypeComponent.java
|
|
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/types/PostgreSqlOtherTypeDataTypeComponent.java
|
Method name: void setPreparedStatementValue(PreparedStatement, Object, int)
|
|
Method name: void setPreparedStatementValue(PreparedStatement, Object, int)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | try {↵ | | |
|
2 | if (value == null) ↵ | | 1 | if (value == null)↵
|
3 | {↵ | | 2 | {↵
|
4 | pstmt.setNull(position, _colDef.getSqlType(), _colDef↵ | | 3 | pstmt.setNull(position, java.sql.Type↵
|
5 | .getSqlTypeName());↵ | | 4 | s.OTHER, typeName);↵
|
6 | } else ↵ | | 5 | } else↵
|
7 | {↵ | | 6 | {↵
|
8 | ↵ | | 7 | try↵
|
| | | 8 | { ↵
|
9 | pstmt.setString(position, value.toString());↵ | | 9 | pstmt.setString(position, value.toString());↵
|
|
10 | }↵ | | |
|
11 | } catch (Exception e) ↵ | | 10 | } catch (Exception e)↵
|
12 | {↵ | | 11 | {↵
|
13 | s_log.error("setPreparedStatementValue: Unexpected exception - "↵ | | 12 | s_log.error("setPreparedStatementValue: Unexpected exception - "↵
|
14 | + e.getMessage(), e);↵ | | 13 | + e.getMessage(), e);↵
|
| | | 14 | }↵
|
|
15 | } | | 15 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1 |