while (reader.hasMoreChildren()) { reader.moveDown(); SampleResult res = (SampleResult) readItem(reader, context, results); samples.add(res); reader.moveUp(); }
while (reader.hasMoreChildren()) { reader.moveDown(); JMeterProperty prop = (JMeterProperty) readItem(reader, context, el); el.setProperty(prop); reader.moveUp(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/converters/TestResultWrapperConverter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/converters/TestElementConverter.java
Method name: Object unmarshal(HierarchicalStreamReader, UnmarshallingContext) Method name: Object unmarshal(HierarchicalStreamReader, UnmarshallingContext)
Number of AST nodes: 5 Number of AST nodes: 5
1
while (reader.hasMoreChildren()) {
1
while (reader.hasMoreChildren()) {
2
			reader.moveDown();
2
				reader.moveDown();
3
			SampleResult res = (SampleResult) readItem(reader, context, results);
3
				JMeterProperty prop = (JMeterProperty) readItem(reader, context, 
4
			samples.add(res
4
el);
5
);
5
				el.setProperty(prop);
6
			reader.moveUp();
6
				reader.moveUp();
7
		}
7
			}
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    while (reader.hasMoreChildren())
    9
    while (reader.hasMoreChildren())
    9
    reader.moveDown();
    10
    reader.moveDown();
    10
    SampleResult res = (SampleResult)readItem(reader, context, results);
    10
    SampleResult res = (SampleResult)readItem(reader, context, results);
    Preondition Violations
    Unmatched statement SampleResult res=(SampleResult)readItem(reader,context,results); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                            
                                                                                                                                            
    11
    JMeterProperty prop = (JMeterProperty)readItem(reader, context, el);
    Preondition Violations
    Unmatched statement JMeterProperty prop=(JMeterProperty)readItem(reader,context,el); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    JMeterProperty prop = (JMeterProperty)readItem(reader, context, el);
    11
    samples.add(res);
    11
    samples.add(res);
    Preondition Violations
    Unmatched statement samples.add(res); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                              
                                                      
    12
    el.setProperty(prop);
    Preondition Violations
    Unmatched statement el.setProperty(prop); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    el.setProperty(prop);
    12
    reader.moveUp();
    13
    reader.moveUp();
    Precondition Violations (4)
    Row Violation
    1Unmatched statement SampleResult res=(SampleResult)readItem(reader,context,results); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement JMeterProperty prop=(JMeterProperty)readItem(reader,context,el); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement samples.add(res); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement el.setProperty(prop); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted