data.next();
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);
}
data.next();
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: 6
|
|
Number of AST nodes: 6
|
|
1 | data.next();↵ | | 1 | data.next();↵
|
2 | for (int i = 0; i < numColumns; i++) {↵ | | 2 | for (int i = 0; i < numColumns; i++) {↵
|
3 | Object o = rs.getObject(i + 1);↵ | | 3 | Object o = rs.getObject(i + 1);↵
|
4 | if (o instanceof byte[]) {↵ | | 4 | if (o instanceof byte[]) {↵
|
5 | o = new String((byte[]) o);↵ | | 5 | o = new String((byte[]) o);↵
|
6 | }↵ | | 6 | }↵
|
7 | data.addColumnValue(dbCols[i], o);↵ | | 7 | data.addColumnValue(dbCols[i], o);↵
|
8 | } | | 8 | }
|
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 | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | data.next(); | | 9 | data.next(); |
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 |