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