while (reader.hasMoreChildren()) { reader.moveDown(); SampleResult res = (SampleResult) readItem(reader, context, results); samples.add(res); reader.moveUp(); }
while (reader.hasMoreChildren()) { reader.moveDown(); JMeterProperty subProp = (JMeterProperty) readItem(reader, context, prop); prop.addProperty(subProp); 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/MultiPropertyConverter.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 subProp = (JMeterProperty) readItem(reader, context, 
4
			samples.add(res
4
prop);
5
);
5
			prop.addProperty(subProp);
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())
    3
    while (reader.hasMoreChildren())
    9
    reader.moveDown();
    4
    reader.moveDown();
                                                                                                                                                    
    5
    JMeterProperty subProp = (JMeterProperty)readItem(reader, context, prop);
    Preondition Violations
    Unmatched statement JMeterProperty subProp=(JMeterProperty)readItem(reader,context,prop); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    JMeterProperty subProp = (JMeterProperty)readItem(reader, context, prop);
                                                              
    6
    prop.addProperty(subProp);
    Preondition Violations
    Unmatched statement prop.addProperty(subProp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    prop.addProperty(subProp);
    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
    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
    reader.moveUp();
    7
    reader.moveUp();
    Precondition Violations (4)
    Row Violation
    1Unmatched statement JMeterProperty subProp=(JMeterProperty)readItem(reader,context,prop); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement prop.addProperty(subProp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched 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
    4Unmatched statement samples.add(res); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted