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(""); }
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(""); }
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: 6 Number of AST nodes: 6
1
Collection parms = new LinkedList();
1
Collection parms = new LinkedList();
2
        for (int c = 0; c < minimum; c++) {
2
        for (int count = 0; count < min; count++) {
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
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)50.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Collection parms = new LinkedList();
    1
    Collection parms = new LinkedList();
    2
    for (int c = 0; c < minimum; c++)
    2
    for (int c = 0; c < minimum; c++)
    2
    for (int count = 0; count < min; count++)
    Differences
    Expression1Expression2Difference
    ccountVARIABLE_NAME_MISMATCH
    ccountVARIABLE_NAME_MISMATCH
    minimumminVARIABLE_NAME_MISMATCH
    ccountVARIABLE_NAME_MISMATCH
    2
    for (int count = 0; count < min; count++)
    3
    try
    3
    try
    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
    parms.add("");
    6
    parms.add("");
    Precondition Violations (0)
    Row Violation