DataSourceElement el = (DataSourceElement) super.clone(); el.excaliburSource = excaliburSource; el.perThreadPoolSet = perThreadPoolSet; return el;
TestElement element = (TestElement) testBeanClass.newInstance(); // configure(element); // super.clear(); // set name, enabled. modifyTestElement(element); // put the default values back into the // new element return element;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
Method name: Object clone() Method name: TestElement createTestElement()
Number of AST nodes: 4 Number of AST nodes: 3
1
DataSourceElement el = (DataSourceElement) super.clone();
2
		el.excaliburSource = excaliburSource;
3
		el.perThreadPoolSet = perThreadPoolSet;
1
TestElement element = (TestElement) testBeanClass.newInstance();
2
			// configure(element);
3
			// super.clear(); // set name, enabled.
4
			modifyTestElement(element); // put the default values back into the
5
			// new element
4
		return el;
6
			return element;
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 in different classes
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    DataSourceElement el = (DataSourceElement)super.clone();
    1
    DataSourceElement el = (DataSourceElement)super.clone();
    2
    TestElement element = (TestElement)testBeanClass.newInstance();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.jdbc.config.DataSourceElementorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    elelementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.jdbc.config.DataSourceElementorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.jdbc.config.DataSourceElementorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    super.clone()testBeanClass.newInstance()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (TestElement)testBeanClass.newInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression testBeanClass.newInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call DataSourceElement el=(DataSourceElement)super.clone(); cannot be extracted from method
    2
    TestElement element = (TestElement)testBeanClass.newInstance();
    2
    el.excaliburSource = excaliburSource;
    2
    el.excaliburSource = excaliburSource;
    Preondition Violations
    Unmatched statement el.excaliburSource=excaliburSource; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
                                                                
    3
    modifyTestElement(element);
    Preondition Violations
    Unmatched statement modifyTestElement(element); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    modifyTestElement(element);
    3
    el.perThreadPoolSet = perThreadPoolSet;
    3
    el.perThreadPoolSet = perThreadPoolSet;
    Preondition Violations
    Unmatched statement el.perThreadPoolSet=perThreadPoolSet; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    4
    return el;
    4
    return el;
    4
    return element;
    Differences
    Expression1Expression2Difference
    elelementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.jdbc.config.DataSourceElementorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    4
    return element;
    Precondition Violations (6)
    Row Violation
    1Expression (TestElement)testBeanClass.newInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression testBeanClass.newInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Super method call DataSourceElement el=(DataSourceElement)super.clone(); cannot be extracted from method
    4Unmatched statement el.excaliburSource=excaliburSource; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement modifyTestElement(element); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement el.perThreadPoolSet=perThreadPoolSet; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted