String buf = pieces[i].trim();
if (buf.endsWith(",")) {
buf = buf.substring(0, buf.length() - 1);
}
insertList.add(buf);
String buf = pieces[i].trim();
if (buf.endsWith(",")) {
buf = buf.substring(0, buf.length() - 1);
}
valuesList.add(buf);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/codereformat/CodeReformator.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/codereformat/CodeReformator.java
|
Method name: ArrayList reformatInsert(ArrayList)
|
|
Method name: ArrayList reformatInsert(ArrayList)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | String buf = pieces[i].trim();↵ | | 1 | String buf = pieces[i].trim();↵
|
2 | if (buf.endsWith(",")) {↵ | | 2 | if (buf.endsWith(",")) {↵
|
3 | buf = buf.substring(0, buf.length() - 1);↵ | | 3 | buf = buf.substring(0, buf.length() - 1);↵
|
4 | }↵ | | 4 | }↵
|
5 | insertList.add(buf); | | 5 | valuesList.add(buf);
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | String buf = pieces[i].trim(); | | 20 | String buf = pieces[i].trim(); |
16 | if (buf.endsWith(",")) | | 21 | if (buf.endsWith(",")) |
17 | buf = buf.substring(0, buf.length() - 1); | | 22 | buf = buf.substring(0, buf.length() - 1); |
18 | insertList.add(buf); | | 23 | valuesList.add(buf); |
Precondition Violations (0)
Row |
Violation |