Collection parms = new LinkedList();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
if (p3 != null) {
parms.add(new CompoundVariable(p3));
}
return parms;
CSVRead cr = new CSVRead();
Collection parms = new LinkedList();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
cr.setParameters(parms);
return cr;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/PackageTest.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/PackageTest.java
|
Method name: Collection MakeParams(String, String, String)
|
|
Method name: CSVRead setCSVReadParams(String, String)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
| | | 1 | CSVRead cr = new CSVRead();↵
|
1 | Collection parms = new LinkedList();↵ | | 2 | Collection parms = new LinkedList();↵
|
2 | if (p1 != null) {↵ | | 3 | if (p1 != null) {↵
|
3 | parms.add(new CompoundVariable(p1));↵ | | 4 | parms.add(new CompoundVariable(p1));↵
|
4 | }↵ | | 5 | }↵
|
5 | if (p2 != null) {↵ | | 6 | if (p2 != null) {↵
|
6 | parms.add(new CompoundVariable(p2));↵ | | 7 | parms.add(new CompoundVariable(p2));↵
|
7 | }↵ | | 8 | }↵
|
8 | if (p3 != null) {↵ | | 9 | ↵
|
9 | parms.add(new CompoundVariable(p3));↵ | | 10 | cr.setParameters(parms);↵
|
10 | }↵ | | 11 | ↵
|
11 | return parms; | | 12 | return cr;
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 23 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 5.9 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | CSVRead cr = new CSVRead(); |
1 | Collection parms = new LinkedList(); | | 2 | Collection parms = new LinkedList(); |
2 | if (p1 != null) | | 3 | if (p1 != null) |
3 | parms.add(new CompoundVariable(p1)); | | 4 | parms.add(new CompoundVariable(p1)); |
4 | if (p2 != null) | | 5 | if (p2 != null) |
5 | parms.add(new CompoundVariable(p2)); | | 6 | parms.add(new CompoundVariable(p2)); |
6 | if (p3 != null) | | | |
7 | parms.add(new CompoundVariable(p3)); | | | |
| | | 7 | cr.setParameters(parms); |
| | | 8 | return cr; |
8 | return parms; | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched return cr; |