while (iter.hasNext()) { JMeterProperty jmp=iter.next(); // Skip special properties if required if (!testFormat22 || !ConversionHelp.isSpecialProperty(jmp.getName())) { // Don't save empty comments - except for the TestPlan (to maintain compatibility) if (!( TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length()==0 && !el.getClass().equals(TestPlan.class) )) { writeItem(jmp, context, writer); } } }
while (iter.hasNext()) { JMeterProperty jmp=iter.next(); // Skip special properties if required if (!testFormat22 || !ConversionHelp.isSpecialProperty(jmp.getName())) { // Don't save empty comments if (!(TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length()==0)) { writeItem(jmp, context, writer); } } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/converters/TestElementConverter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/converters/TestElementPropertyConverter.java
Method name: void marshal(Object, HierarchicalStreamWriter, MarshallingContext) Method name: void marshal(Object, HierarchicalStreamWriter, MarshallingContext)
Number of AST nodes: 5 Number of AST nodes: 5
1
while (iter.hasNext()) {
1
while (iter.hasNext()) {
2
            JMeterProperty jmp=iter.next();
2
            JMeterProperty jmp=iter.next();
3
            // Skip special properties if required
3
            // Skip special properties if required
4
            if (!testFormat22 || !ConversionHelp.isSpecialProperty(jmp.getName())) 
4
            if (!testFormat22 || !ConversionHelp.isSpecialProperty(jmp.getName())) 
5
{
5
            {
6
            	// Don't save empty comments - except for the TestPlan (to maintain compatibility)
6
            	// Don't save empty comments
7
	       		if (!(
7
	       		if (!(
8
	       				TestElement.COMMENTS.equals(jmp.getName())
8
TestElement.COMMENTS.equals(jmp.getName())
9
		       			&& jmp.getStringValue().length()==0
9
		       			&& jmp.getStringValue().length()==0
10
		       			&& !el.getClass().equals(TestPlan.class)
11
	       			))
10
))
12
	       		{
11
		       	{
13
		            writeItem(jmp, context, writer);
12
		            writeItem(jmp, context, writer);
14
	       		}
13
		       	}
15
            }
14
            }
16
		}
15
		}
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    while (iter.hasNext())
    9
    while (iter.hasNext())
    6
    JMeterProperty jmp = iter.next();
    10
    JMeterProperty jmp = iter.next();
    7
    if (!testFormat22 || !ConversionHelp.isSpecialProperty(jmp.getName()))
    11
    if (!testFormat22 || !ConversionHelp.isSpecialProperty(jmp.getName()))
    8
    if (!(TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0 && !el.getClass().equals(TestPlan.class)))
    8
    if (!(TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0 && !el.getClass().equals(TestPlan.class)))
    12
    if (!(TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0))
    Differences
    Expression1Expression2Difference
    TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0TestElement.COMMENTS.equals(jmp.getName())INFIX_LEFT_OPERAND_MISMATCH
    !el.getClass().equals(TestPlan.class)jmp.getStringValue().length() == 0INFIX_RIGHT_OPERAND_MISMATCH
    Preondition Violations
    Expression TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0 && !el.getClass().equals(TestPlan.class) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!(TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0))
    9
    writeItem(jmp, context, writer);
    13
    writeItem(jmp, context, writer);
    Precondition Violations (2)
    Row Violation
    1Expression TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0 && !el.getClass().equals(TestPlan.class) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression TestElement.COMMENTS.equals(jmp.getName()) && jmp.getStringValue().length() == 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted