SyncTimer newTimer = (SyncTimer) super.clone(); newTimer.timerCounter = timerCounter; newTimer.sync = sync; return newTimer;
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/timers/SyncTimer.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
SyncTimer newTimer = (SyncTimer) super.clone();
2
		newTimer.timerCounter = timerCounter;
3
		newTimer.sync = sync;
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 newTimer;
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
    SyncTimer newTimer = (SyncTimer)super.clone();
    1
    SyncTimer newTimer = (SyncTimer)super.clone();
    2
    TestElement element = (TestElement)testBeanClass.newInstance();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.timers.SyncTimerorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    newTimerelementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.timers.SyncTimerorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.timers.SyncTimerorg.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 SyncTimer newTimer=(SyncTimer)super.clone(); cannot be extracted from method
    2
    TestElement element = (TestElement)testBeanClass.newInstance();
    2
    newTimer.timerCounter = timerCounter;
    2
    newTimer.timerCounter = timerCounter;
    Preondition Violations
    Unmatched statement newTimer.timerCounter=timerCounter; 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
    newTimer.sync = sync;
    3
    newTimer.sync = sync;
    Preondition Violations
    Unmatched statement newTimer.sync=sync; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                
    4
    return newTimer;
    4
    return newTimer;
    4
    return element;
    Differences
    Expression1Expression2Difference
    newTimerelementVARIABLE_NAME_MISMATCH
    org.apache.jmeter.timers.SyncTimerorg.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 SyncTimer newTimer=(SyncTimer)super.clone(); cannot be extracted from method
    4Unmatched statement newTimer.timerCounter=timerCounter; 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 newTimer.sync=sync; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted