if (el != null) { super.addTestElement(el); log.info("TestElement: " + el.getClass().getName()); }
if(lastUsed != null) { managersInUse.remove(lastUsed); managersInUse.notify(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/AbstractTable.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java
Method name: void addTestElement(TestElement) Method name: CookieManager getCookieManager(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (el != null) {
1
if
2
            super.addTestElement(el);
3
            log.info("TestElement: " + el.getClass().getName()
2
(lastUsed != null)
3
            {
4
                managersInUse.remove(lastUsed);
4
);
5
                managersInUse.notify(); 
5
        }
6
            }
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.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (el != null)
    1
    if (el != null)
    3
    if (lastUsed != null)
    Differences
    Expression1Expression2Difference
    ellastUsedVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.TestElementorg.apache.jmeter.protocol.http.control.CookieManagerSUBCLASS_TYPE_MISMATCH
    3
    if (lastUsed != null)
                                                                        
    4
    managersInUse.remove(lastUsed);
    Preondition Violations
    Unmatched statement managersInUse.remove(lastUsed); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    managersInUse.remove(lastUsed);
    2
    super.addTestElement(el);
    2
    super.addTestElement(el);
    5
    managersInUse.notify();
    Differences
    Expression1Expression2Difference
    super.addTestElement(el)managersInUse.notify()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.addTestElement(el) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression managersInUse.notify() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression super.addTestElement(el) is a void method call, and thus it cannot be parameterized
    Expression managersInUse.notify() is a void method call, and thus it cannot be parameterized
    Super method call super.addTestElement(el); cannot be extracted from method
    5
    managersInUse.notify();
    3
    log.info("TestElement: " + el.getClass().getName());
    3
    log.info("TestElement: " + el.getClass().getName());
    Preondition Violations
    Unmatched statement log.info("TestElement: " + el.getClass().getName()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                  
    Precondition Violations (7)
    Row Violation
    1Unmatched statement managersInUse.remove(lastUsed); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression super.addTestElement(el) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression managersInUse.notify() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression super.addTestElement(el) is a void method call, and thus it cannot be parameterized
    5Expression managersInUse.notify() is a void method call, and thus it cannot be parameterized
    6Super method call super.addTestElement(el); cannot be extracted from method
    7Unmatched statement log.info("TestElement: " + el.getClass().getName()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted