while (reader.hasMoreChildren()) { reader.moveDown(); SampleResult res = (SampleResult) readItem(reader, context, results); samples.add(res); reader.moveUp(); }
startTag(tagname); sb.append(content); endTag(tagname); return this;
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/jorphan/util/XMLBuffer.java
Method name: Object unmarshal(HierarchicalStreamReader, UnmarshallingContext) Method name: XMLBuffer tag(String, String)
Number of AST nodes: 5 Number of AST nodes: 4
1
while (reader.hasMoreChildren()) {
2
			reader.moveDown();
3
			SampleResult res = (SampleResult) readItem(reader, context, results);
4
			samples.add(res
1
startTag(tagname);
2
		sb.append(content);
5
);
3
		endTag(tagname);
6
			reader.moveUp();
4
		re
7
		}
5
turn this;
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    reader.moveDown();
    9
    reader.moveDown();
    1
    startTag(tagname);
    Differences
    Expression1Expression2Difference
    moveDownstartTagMETHOD_INVOCATION_NAME_MISMATCH
    reader.moveDown()startTag(tagname)ARGUMENT_NUMBER_MISMATCH
    readerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression reader.moveDown() is a void method call, and thus it cannot be parameterized
    Expression startTag(tagname) is a void method call, and thus it cannot be parameterized
    Expression reader.moveDown() is a void method call, and thus it cannot be parameterized
    Expression startTag(tagname) is a void method call, and thus it cannot be parameterized
    1
    startTag(tagname);
                                                
    2
    sb.append(content);
    Preondition Violations
    Unmatched statement sb.append(content); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    sb.append(content);
                                  
    4
    return this;
    Preondition Violations
    Unmatched return this;
    4
    return this;
    10
    SampleResult res = (SampleResult)readItem(reader, context, results);
                                                                                                                                            
    11
    samples.add(res);
                                              
    12
    reader.moveUp();
    12
    reader.moveUp();
    3
    endTag(tagname);
    Differences
    Expression1Expression2Difference
    moveUpendTagMETHOD_INVOCATION_NAME_MISMATCH
    reader.moveUp()endTag(tagname)ARGUMENT_NUMBER_MISMATCH
    readerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression reader.moveUp() is a void method call, and thus it cannot be parameterized
    Expression endTag(tagname) is a void method call, and thus it cannot be parameterized
    Expression reader.moveUp() is a void method call, and thus it cannot be parameterized
    Expression endTag(tagname) is a void method call, and thus it cannot be parameterized
    3
    endTag(tagname);
    Precondition Violations (10)
    Row Violation
    1Expression reader.moveDown() is a void method call, and thus it cannot be parameterized
    2Expression startTag(tagname) is a void method call, and thus it cannot be parameterized
    3Expression reader.moveDown() is a void method call, and thus it cannot be parameterized
    4Expression startTag(tagname) is a void method call, and thus it cannot be parameterized
    5Unmatched statement sb.append(content); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return this;
    7Expression reader.moveUp() is a void method call, and thus it cannot be parameterized
    8Expression endTag(tagname) is a void method call, and thus it cannot be parameterized
    9Expression reader.moveUp() is a void method call, and thus it cannot be parameterized
    10Expression endTag(tagname) is a void method call, and thus it cannot be parameterized