Collection parms = new LinkedList();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
Collection parms = new LinkedList();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
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: CSVRead setCSVReadParams(String, String)
|
|
Method name: Collection MakeParams(String, String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Collection parms = new LinkedList();↵ | | 1 | Collection parms = new LinkedList();↵
|
2 | if (p1 != null) {↵ | | 2 | if (p1 != null) {↵
|
3 | parms.add(new CompoundVariable(p1));↵ | | 3 | parms.add(new CompoundVariable(p1));↵
|
4 | }↵ | | 4 | }↵
|
5 | if (p2 != null) {↵ | | 5 | if (p2 != null) {↵
|
6 | parms.add(new CompoundVariable(p2));↵ | | 6 | parms.add(new CompoundVariable(p2));↵
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{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) | 4.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | Collection parms = new LinkedList(); | | 1 | Collection parms = new LinkedList(); |
3 | if (p1 != null) | | 2 | if (p1 != null) |
4 | parms.add(new CompoundVariable(p1)); | | 3 | parms.add(new CompoundVariable(p1)); |
5 | if (p2 != null) | | 4 | if (p2 != null) |
6 | parms.add(new CompoundVariable(p2)); | | 5 | parms.add(new CompoundVariable(p2)); |
Precondition Violations (0)
Row |
Violation |