params.add(new CompoundVariable()); params.add(new CompoundVariable()); variable.setParameters(params); long before = System.currentTimeMillis(); value = variable.execute(result, null); long now= Long.parseLong(value); long after = System.currentTimeMillis(); assertTrue(now >= before && now <= after);
params.add(new CompoundVariable()); variable.setParameters(params); long before = System.currentTimeMillis(); value = variable.execute(result, null); long now= Long.parseLong(value); long after = System.currentTimeMillis(); assertTrue(now >= before && now <= after);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestTimeFunction.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestTimeFunction.java
Method name: void testDefault2() Method name: void testDefault1()
Number of AST nodes: 8 Number of AST nodes: 7
1
params.add(new CompoundVariable());
2
            params.add(new CompoundVariable());
1
params.add(new CompoundVariable());
3
            variable.setParameters(params);
2
            variable.setParameters(params);
4
            long before = System.currentTimeMillis();
3
            long before = System.currentTimeMillis();
5
            value = variable.execute(result, null);
4
            value = variable.execute(result, null);
6
            long now= Long.parseLong(value);
5
            long now= Long.parseLong(value);
7
            long after = System.currentTimeMillis();
6
            long after = System.currentTimeMillis();
8
            assertTrue(now >= before && now <= after);
7
            assertTrue(now >= before && now <= after);
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.0
Clones locationClones are declared in the same class
Number of node comparisons43
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    params.add(new CompoundVariable());
    1
    params.add(new CompoundVariable());
    2
    params.add(new CompoundVariable());
    2
    params.add(new CompoundVariable());
    Preondition Violations
    Unmatched statement params.add(new CompoundVariable()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                
    3
    variable.setParameters(params);
    2
    variable.setParameters(params);
    4
    long before = System.currentTimeMillis();
    3
    long before = System.currentTimeMillis();
    5
    value = variable.execute(result, null);
    4
    value = variable.execute(result, null);
    6
    long now = Long.parseLong(value);
    5
    long now = Long.parseLong(value);
    7
    long after = System.currentTimeMillis();
    6
    long after = System.currentTimeMillis();
    8
    assertTrue(now >= before && now <= after);
    7
    assertTrue(now >= before && now <= after);
    Precondition Violations (1)
    Row Violation
    1Unmatched statement params.add(new CompoundVariable()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted