toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2); toBeCentered.validate(); toBeCentered.repaint();
super.configure(el); XPathAssertion assertion = (XPathAssertion) el; xpath.setXPath(assertion.getXPathString()); xpath.setNegated(assertion.isNegated()); xml.configure(assertion);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/ComponentUtil.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
Method name: void centerComponentInComponent(Component, Component) Method name: void configure(TestElement)
Number of AST nodes: 3 Number of AST nodes: 5
1
toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY()
2
				+ (parent.getHeight() - toBeCentered.getHeight()) / 2);
3
		toBeCentered.validate();
4
		toBeCentered.repaint(
1
super.configure(el);
2
		XPathAssertion assertion = (XPathAssertion) el;
3
		xpath.setXPath(assertion.getXPathString());
4
		xpath.setNegated(assertion.isNegated());
5
);
5
		xml.configure(assertion);
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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2);
    1
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2);
    1
    super.configure(el);
    Differences
    Expression1Expression2Difference
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2)super.configure(el)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2) is a void method call, and thus it cannot be parameterized
    Expression super.configure(el) is a void method call, and thus it cannot be parameterized
    1
    super.configure(el);
                                                                                                  
    2
    XPathAssertion assertion = (XPathAssertion)el;
    2
    toBeCentered.validate();
    2
    toBeCentered.validate();
    4
    xpath.setNegated(assertion.isNegated());
    Differences
    Expression1Expression2Difference
    validatesetNegatedMETHOD_INVOCATION_NAME_MISMATCH
    toBeCenteredxpathVARIABLE_NAME_MISMATCH
    java.awt.Componentorg.apache.jmeter.assertions.gui.XPathPanelSUBCLASS_TYPE_MISMATCH
    toBeCentered.validate()xpath.setNegated(assertion.isNegated())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    Expression xpath.setNegated(assertion.isNegated()) is a void method call, and thus it cannot be parameterized
    Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    Expression xpath.setNegated(assertion.isNegated()) is a void method call, and thus it cannot be parameterized
    4
    xpath.setNegated(assertion.isNegated());
    3
    toBeCentered.repaint();
    3
    toBeCentered.repaint();
    3
    xpath.setXPath(assertion.getXPathString());
    Differences
    Expression1Expression2Difference
    repaintsetXPathMETHOD_INVOCATION_NAME_MISMATCH
    toBeCenteredxpathVARIABLE_NAME_MISMATCH
    java.awt.Componentorg.apache.jmeter.assertions.gui.XPathPanelSUBCLASS_TYPE_MISMATCH
    toBeCentered.repaint()xpath.setXPath(assertion.getXPathString())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    Expression xpath.setXPath(assertion.getXPathString()) is a void method call, and thus it cannot be parameterized
    Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    Expression xpath.setXPath(assertion.getXPathString()) is a void method call, and thus it cannot be parameterized
    3
    xpath.setXPath(assertion.getXPathString());
                                                            
    5
    xml.configure(assertion);
    Precondition Violations (10)
    Row Violation
    1Expression toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2) is a void method call, and thus it cannot be parameterized
    2Expression super.configure(el) is a void method call, and thus it cannot be parameterized
    3Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    4Expression xpath.setNegated(assertion.isNegated()) is a void method call, and thus it cannot be parameterized
    5Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    6Expression xpath.setNegated(assertion.isNegated()) is a void method call, and thus it cannot be parameterized
    7Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    8Expression xpath.setXPath(assertion.getXPathString()) is a void method call, and thus it cannot be parameterized
    9Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    10Expression xpath.setXPath(assertion.getXPathString()) is a void method call, and thus it cannot be parameterized