boolean data = rs.getBoolean(index);
if (rs.wasNull())
{
return null;
}
else
{
return Boolean.valueOf(data);
}
long data = rs.getLong(index);
if (rs.wasNull()) {
return null;
} else {
return Long.valueOf(data);
}
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBoolean.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeLong.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 | boolean data = rs.getBoolean(index);↵ | | 1 | long data = rs.getLong(index);↵
|
2 | if (rs.wasNull())↵ | | 2 | if (rs.wasNull())↵
|
3 | {↵ | | 3 | {↵
|
4 | return null;↵ | | 4 | return null;↵
|
5 | }↵ | | |
|
6 | else↵ | | |
|
7 | {↵ | | |
|
8 | return Boolean↵ | | 5 | } else {↵
|
9 | .valueOf(data);↵ | | 6 | return Long.valueOf(data);↵
|
10 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | long data = rs.getLong(index); |
1 | boolean data = rs.getBoolean(index); | | | |
2 | if (rs.wasNull()) | | 2 | if (rs.wasNull()) |
3 | | | 3 | |
| | | | |
| | | 4 | return Long.valueOf(data); |
4 | return Boolean.valueOf(data); | | | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched return Long.valueOf(data); |
2 | Unmatched return Boolean.valueOf(data); |
3 | Not all possible execution flows end in a return statement |