SyncTimer newTimer = (SyncTimer) super.clone(); newTimer.timerCounter = timerCounter; newTimer.sync = sync; return newTimer;
for (int counter = 0; counter < order.length; counter++) { TestElement sampler = test.next(); assertNotNull(sampler); assertEquals("Counter: " + counter, order[counter], sampler.getName()); }
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/test/src/org/apache/jmeter/control/TestThroughputController.java
Method name: Object clone() Method name: void testByNumber()
Number of AST nodes: 4 Number of AST nodes: 4
1
SyncTimer newTimer = (SyncTimer) super.clone();
2
		newTimer.timerCounter = timerCounter;
3
		newTimer.sync = sync;
4
		return newTimer;
1
for (int counter = 0; counter < order.length; counter++) {
2
				TestElement sampler = test.next();
3
				assertNotNull(sampler);
4
				assertEquals("Counter: " + counter, order[counter], sampler.getName());
5
			}
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
    SyncTimer newTimer = (SyncTimer)super.clone();
    1
    SyncTimer newTimer = (SyncTimer)super.clone();
    22
    TestElement sampler = test.next();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.timers.SyncTimerorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    newTimersamplerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.timers.SyncTimerorg.apache.jmeter.testelement.TestElementSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.timers.SyncTimerorg.apache.jmeter.samplers.SamplerSUBCLASS_TYPE_MISMATCH
    (SyncTimer)super.clone()test.next()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression test.next() 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
    22
    TestElement sampler = test.next();
    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
    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;
    Preondition Violations
    Unmatched statement return newTimer; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return newTimer;
                                          
                                                          
    23
    assertNotNull(sampler);
    Preondition Violations
    Unmatched statement assertNotNull(sampler); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23
    assertNotNull(sampler);
                                                                                                                                                      
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    Preondition Violations
    Unmatched statement assertEquals("Counter: " + counter,order[counter],sampler.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24
    assertEquals("Counter: " + counter, order[counter], sampler.getName());
    Precondition Violations (10)
    Row Violation
    1Expression test.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Super method call SyncTimer newTimer=(SyncTimer)super.clone(); cannot be extracted from method
    3Unmatched statement newTimer.timerCounter=timerCounter; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement newTimer.sync=sync; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement return newTimer; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return newTimer;
    7Unmatched statement assertNotNull(sampler); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement assertEquals("Counter: " + counter,order[counter],sampler.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variable newTimer with type org.apache.jmeter.timers.SyncTimer , while Clone fragment #2 returns variable sampler with type org.apache.jmeter.testelement.TestElement
    10The refactoring of the clones is infeasible, because classes org.apache.jmeter.timers.SyncTimer and org.apache.jmeter.control.TestThroughputController do not have a common superclass