for (int i = 0; i < numColumns; i++) {
Object o = rs.getObject(i + 1);
if (o instanceof byte[]) {
o = new String((byte[]) o);
}
data.addColumnValue(dbCols[i], o);
}
for (int i = 0; i < numColumns; i++) {
Object o = rs.getObject(i + 1);
if (o instanceof byte[]) {
o = new String((byte[]) o);
}
data.addColumnValue(dbCols[i], o);
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/Data.java
|
Method name: Data getDataFromResultSet(ResultSet)
|
|
Method name: Data getDataFromResultSet(ResultSet)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int i = 0; i < numColumns; i++) {↵ | | 1 | for (int i = 0; i < numColumns; i++) {↵
|
2 | Object o = rs.getObject(i + 1);↵ | | 2 | Object o = rs.getObject(i + 1);↵
|
3 | if (o instanceof byte[]) {↵ | | 3 | if (o instanceof byte[]) {↵
|
4 | o = new String((byte[]) o);↵ | | 4 | o = new String((byte[]) o);↵
|
5 | }↵ | | 5 | }↵
|
6 | data.addColumnValue(dbCols[i], o);↵ | | 6 | data.addColumnValue(dbCols[i], o);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 19 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | for (int i = 0; i < numColumns; i++) | | 10 | for (int i = 0; i < numColumns; i++) |
11 | Object o = rs.getObject(i + 1); | | 11 | Object o = rs.getObject(i + 1); |
12 | | | 12 | |
13 | o = new String((byte[])o); | | 13 | o = new String((byte[])o); |
14 | data.addColumnValue(dbCols[i], o); | | 14 | data.addColumnValue(dbCols[i], o); |
Precondition Violations (0)
Row |
Violation |