if (element instanceof IfController) { IfController ifController = (IfController) element; theCondition.setText(ifController.getCondition()); evaluateAll.setSelected(ifController.isEvaluateAll()); }
if (el instanceof XPathAssertion) { XPathAssertion assertion = (XPathAssertion) el; assertion.setNegated(xpath.isNegated()); assertion.setXPathString(xpath.getXPath()); xml.modifyTestElement(assertion); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/IfControllerPanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
Method name: void configure(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 4 Number of AST nodes: 5
1
if (element instanceof IfController) {
1
if (el instanceof 
2
			IfController ifController = (IfController) element;
3
			theCondition.setText(ifController.getCondition());
4
			evaluateAll.setSelected(ifController.isEvaluateAll()
2
XPathAssertion) {
3
			XPathAssertion assertion = (XPathAssertion) el;
4
			assertion.setNegated(xpath.isNegated());
5
			assertion.setXPathString(xpath.getXPath());
5
);
6
			xml.modifyTestElement(assertion);
6
		}
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 comparisons20
  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 fragment3
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    if (element instanceof IfController)
    2
    if (element instanceof IfController)
    2
    if (el instanceof XPathAssertion)
    Differences
    Expression1Expression2Difference
    elementelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.control.IfControllerorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    2
    if (el instanceof XPathAssertion)
    3
    IfController ifController = (IfController)element;
    3
    IfController ifController = (IfController)element;
    3
    XPathAssertion assertion = (XPathAssertion)el;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.control.IfControllerorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    ifControllerassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.control.IfControllerorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.control.IfControllerorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    elementelVARIABLE_NAME_MISMATCH
    3
    XPathAssertion assertion = (XPathAssertion)el;
                                                                                          
    4
    assertion.setNegated(xpath.isNegated());
    4
    theCondition.setText(ifController.getCondition());
                                                                                                              
                                                                                                
    5
    assertion.setXPathString(xpath.getXPath());
    5
    evaluateAll.setSelected(ifController.isEvaluateAll());
                                                                                                                      
                                                                            
    6
    xml.modifyTestElement(assertion);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variable ifController with type org.apache.jmeter.control.IfController , while Clone fragment #2 returns variable assertion with type org.apache.jmeter.assertions.XPathAssertion