Collection parms = new LinkedList();
for (int count = 0; count < min; count++) {
try {
func.setParameters(parms);
fail("Should have generated InvalidVariableException for " + parms.size()
+ " parameters");
} catch (InvalidVariableException ignored) {
}
parms.add("");
}
Collection parms = new LinkedList();
for (int c = 0; c < minimum; c++) {
try {
func.setParameters(parms);
fail("Should have generated InvalidVariableException for " + parms.size()
+ " parameters");
} catch (InvalidVariableException ignored) {
}
parms.add("");
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTestCase.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTestCase.java
|
Method name: void checkInvalidParameterCounts(AbstractFunction, int, int)
|
|
Method name: void checkInvalidParameterCounts(AbstractFunction, int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | Collection parms = new LinkedList();↵ | | 1 | Collection parms = new LinkedList();↵
|
2 | for (int count = 0; count < min; count++) {↵ | | 2 | for (int c = 0; c < minimum; c++) {↵
|
3 | try {↵ | | 3 | try {↵
|
4 | func.setParameters(parms);↵ | | 4 | func.setParameters(parms);↵
|
5 | fail("Should have generated InvalidVariableException for " + parms.size()↵ | | 5 | fail("Should have generated InvalidVariableException for " + parms.size()↵
|
6 | + " parameters");↵ | | 6 | + " parameters");↵
|
7 | } catch (InvalidVariableException ignored) {↵ | | 7 | } catch (InvalidVariableException ignored) {↵
|
8 | }↵ | | 8 | }↵
|
9 | parms.add("");↵ | | 9 | parms.add("");↵
|
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 declared in the same class |
Number of node comparisons | 14 |
-
{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) | 10.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Collection parms = new LinkedList(); | | 1 | Collection parms = new LinkedList(); |
2 | for (int count = 0; count < min; count++) | | 2 | for (int c = 0; c < minimum; c++) |
3 | | | 3 | |
4 | func.setParameters(parms); | | 4 | func.setParameters(parms); |
5 | fail("Should have generated InvalidVariableException for " + parms.size() + " parameters"); | | 5 | fail("Should have generated InvalidVariableException for " + parms.size() + " parameters"); |
6 | | | 6 | |
Precondition Violations (0)
Row |
Violation |