super.configureTestElement(el); if (el instanceof XPathAssertion) { XPathAssertion assertion = (XPathAssertion) el; assertion.setNegated(xpath.isNegated()); assertion.setXPathString(xpath.getXPath()); xml.modifyTestElement(assertion); }
configureTestElement(controller); if (controller instanceof IfController) { IfController ifController = (IfController) controller; ifController.setCondition(theCondition.getText()); ifController.setEvaluateAll(evaluateAll.isSelected()); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XPathAssertionGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/IfControllerPanel.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 6 Number of AST nodes: 5
1
super.configureTestElement(el);
1
configureTestElement(
2
		if (el instanceof XPathAssertion) {
3
			XPathAssertion assertion = (XPathAssertion) el;
4
			assertion.setNegated(xpath.isNegated());
5
			assertion.setXPathString(xpath.getXPath());
6
			xml.modifyTestElement(assertion
2
controller);
3
		if (controller instanceof IfController) {
4
			IfController ifController = (IfController) controller;
5
			ifController.setCondition(theCondition.getText());
7
);
6
			ifController.setEvaluateAll(evaluateAll.isSelected());
8
		}
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 comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5147.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    super.configureTestElement(el);
    1
    super.configureTestElement(el);
    1
    configureTestElement(controller);
    Differences
    Expression1Expression2Difference
    super.configureTestElement(el)configureTestElement(controller)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression configureTestElement(controller) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression super.configureTestElement(el) is a void method call, and thus it cannot be parameterized
    Expression configureTestElement(controller) is a void method call, and thus it cannot be parameterized
    1
    configureTestElement(controller);
    2
    if (el instanceof XPathAssertion)
    2
    if (el instanceof XPathAssertion)
    2
    if (controller instanceof IfController)
    Differences
    Expression1Expression2Difference
    elcontrollerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.assertions.XPathAssertionorg.apache.jmeter.control.IfControllerSUBCLASS_TYPE_MISMATCH
    2
    if (controller instanceof IfController)
    3
    XPathAssertion assertion = (XPathAssertion)el;
    3
    XPathAssertion assertion = (XPathAssertion)el;
    3
    IfController ifController = (IfController)controller;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.assertions.XPathAssertionorg.apache.jmeter.control.IfControllerSUBCLASS_TYPE_MISMATCH
    assertionifControllerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.assertions.XPathAssertionorg.apache.jmeter.control.IfControllerSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.assertions.XPathAssertionorg.apache.jmeter.control.IfControllerSUBCLASS_TYPE_MISMATCH
    elcontrollerVARIABLE_NAME_MISMATCH
    3
    IfController ifController = (IfController)controller;
    4
    assertion.setNegated(xpath.isNegated());
    4
    assertion.setNegated(xpath.isNegated());
    5
    ifController.setEvaluateAll(evaluateAll.isSelected());
    Differences
    Expression1Expression2Difference
    setNegatedsetEvaluateAllMETHOD_INVOCATION_NAME_MISMATCH
    isNegatedisSelectedMETHOD_INVOCATION_NAME_MISMATCH
    xpathevaluateAllVARIABLE_NAME_MISMATCH
    org.apache.jmeter.assertions.gui.XPathPaneljavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    assertionifControllerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.assertions.XPathAssertionorg.apache.jmeter.control.IfControllerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ifController.setEvaluateAll(evaluateAll.isSelected()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    Expression ifController.setEvaluateAll(evaluateAll.isSelected()) is a void method call, and thus it cannot be parameterized
    5
    ifController.setEvaluateAll(evaluateAll.isSelected());
    5
    assertion.setXPathString(xpath.getXPath());
    5
    assertion.setXPathString(xpath.getXPath());
    4
    ifController.setCondition(theCondition.getText());
    Differences
    Expression1Expression2Difference
    setXPathStringsetConditionMETHOD_INVOCATION_NAME_MISMATCH
    getXPathgetTextMETHOD_INVOCATION_NAME_MISMATCH
    xpaththeConditionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.assertions.gui.XPathPaneljavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    assertionifControllerVARIABLE_NAME_MISMATCH
    org.apache.jmeter.assertions.XPathAssertionorg.apache.jmeter.control.IfControllerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression assertion.setXPathString(xpath.getXPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ifController.setCondition(theCondition.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setXPathString(xpath.getXPath()) is a void method call, and thus it cannot be parameterized
    Expression ifController.setCondition(theCondition.getText()) is a void method call, and thus it cannot be parameterized
    4
    ifController.setCondition(theCondition.getText());
    6
    xml.modifyTestElement(assertion);
                                                                            
    Precondition Violations (12)
    Row Violation
    1Expression configureTestElement(controller) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression super.configureTestElement(el) is a void method call, and thus it cannot be parameterized
    3Expression configureTestElement(controller) is a void method call, and thus it cannot be parameterized
    4Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression ifController.setEvaluateAll(evaluateAll.isSelected()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    7Expression ifController.setEvaluateAll(evaluateAll.isSelected()) is a void method call, and thus it cannot be parameterized
    8Expression assertion.setXPathString(xpath.getXPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression ifController.setCondition(theCondition.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertion.setXPathString(xpath.getXPath()) is a void method call, and thus it cannot be parameterized
    11Expression ifController.setCondition(theCondition.getText()) is a void method call, and thus it cannot be parameterized
    12Clone fragment #1 returns variables assertion , while Clone fragment #2 returns variables