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("");
}
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("");
}
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)
|
|
Method name: void checkInvalidParameterCounts(AbstractFunction, int, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int c = 0; c < minimum; c++) {↵ | | 1 | for (int count = 0; count < min; count++) {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | func.setParameters(parms);↵ | | 3 | func.setParameters(parms);↵
|
4 | fail("Should have generated InvalidVariableException for " + parms.size()↵ | | 4 | fail("Should have generated InvalidVariableException for " + parms.size()↵
|
5 | + " parameters");↵ | | 5 | + " parameters");↵
|
6 | } catch (InvalidVariableException ignored) {↵ | | 6 | } catch (InvalidVariableException ignored) {↵
|
7 | }↵ | | 7 | }↵
|
8 | parms.add("");↵ | | 8 | parms.add("");↵
|
9 | } | | 9 | }
|
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 | 13 |
-
{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) | 51.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | for (int c = 0; c < minimum; c++) | | 2 | for (int count = 0; count < min; count++) |
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 |