SyncTimer newTimer = (SyncTimer) super.clone(); newTimer.timerCounter = timerCounter; newTimer.sync = sync; return newTimer;
ObjectProperty p = (ObjectProperty) super.clone(); p.value = value; return p;
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/testelement/property/ObjectProperty.java
Method name: Object clone() Method name: Object clone()
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
ObjectProperty p = (ObjectProperty) super.clone();
4
;
2
		p.value = value;
5
		return newTimer;
3
		return p;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                        
    1
    ObjectProperty p = (ObjectProperty)super.clone();
    1
    SyncTimer newTimer = (SyncTimer)super.clone();
                                                                                                  
    2
    newTimer.timerCounter = timerCounter;
    2
    newTimer.timerCounter = timerCounter;
    Preondition Violations
    Unmatched statement newTimer.timerCounter=timerCounter; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                
    3
    newTimer.sync = sync;
    3
    newTimer.sync = sync;
    2
    p.value = value;
    Differences
    Expression1Expression2Difference
    newTimerpVARIABLE_NAME_MISMATCH
    org.apache.jmeter.timers.SyncTimerorg.apache.jmeter.testelement.property.ObjectPropertyVARIABLE_TYPE_MISMATCH
    syncvalueVARIABLE_NAME_MISMATCH
    syncvalueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression newTimer.sync cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Object of variable newTimer.sync does not match with type java.lang.Object of variable p.value
    • Make classes org.apache.jmeter.timers.SyncTimer and org.apache.jmeter.testelement.property.ObjectProperty extend a common superclass
    Expression newTimer.sync cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression newTimer.sync is a field being modified, and thus it cannot be parameterized
    Expression p.value is a field being modified, and thus it cannot be parameterized
    2
    p.value = value;
                            
    3
    return p;
    4
    return newTimer;
                                          
    Precondition Violations (8)
    Row Violation
    1Unmatched statement newTimer.timerCounter=timerCounter; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression newTimer.sync cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression p.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.Object of variable newTimer.sync does not match with type java.lang.Object of variable p.value
    5Expression newTimer.sync cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression p.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression newTimer.sync is a field being modified, and thus it cannot be parameterized
    8Expression p.value is a field being modified, and thus it cannot be parameterized