super.configureTestElement(plan); if (plan instanceof ReportPlan) { ReportPlan rp = (ReportPlan) plan; rp.setUserDefinedVariables((Arguments) argsPanel.createTestElement()); rp.setProperty(ReportPlan.COMMENTS, commentPanel.getText()); rp.setBasedir(baseDir.getFilename()); }
super.configureTestElement(el); 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/ReportGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
Method name: void modifyTestElement(TestElement) Method name: void modifyTestElement(TestElement)
Number of AST nodes: 6 Number of AST nodes: 6
1
super.configureTestElement(plan);
1
super.configureTestElement(el);
2
		if (plan instanceof ReportPlan) {
2
		if (el instanceof 
3
			ReportPlan rp = (ReportPlan) plan;
4
			rp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());
5
			rp.setProperty(ReportPlan.COMMENTS, commentPanel.getText());
6
            rp.setBasedir(baseDir.getFilename()
3
XPathAssertion) {
4
			XPathAssertion assertion = (XPathAssertion) el;
5
			assertion.setNegated(xpath.isNegated());
6
			assertion.setXPathString(xpath.getXPath());
7
);
7
			xml.modifyTestElement(assertion);
8
		}
8
		}
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 comparisons26
  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 fragment1
    Time elapsed for statement mapping (ms)1066.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super.configureTestElement(plan);
    1
    super.configureTestElement(plan);
    1
    super.configureTestElement(el);
    Differences
    Expression1Expression2Difference
    planelVARIABLE_NAME_MISMATCH
    1
    super.configureTestElement(el);
    2
    if (plan instanceof ReportPlan)
    2
    if (plan instanceof ReportPlan)
    2
    if (el instanceof XPathAssertion)
    Differences
    Expression1Expression2Difference
    planelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.ReportPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    2
    if (el instanceof XPathAssertion)
    3
    ReportPlan rp = (ReportPlan)plan;
    3
    ReportPlan rp = (ReportPlan)plan;
    3
    XPathAssertion assertion = (XPathAssertion)el;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.testelement.ReportPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    rpassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.ReportPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.testelement.ReportPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    planelVARIABLE_NAME_MISMATCH
    3
    XPathAssertion assertion = (XPathAssertion)el;
    4
    rp.setUserDefinedVariables((Arguments)argsPanel.createTestElement());
                                                                                                                                                    
    5
    rp.setProperty(ReportPlan.COMMENTS, commentPanel.getText());
    5
    rp.setProperty(ReportPlan.COMMENTS, commentPanel.getText());
    4
    assertion.setNegated(xpath.isNegated());
    Differences
    Expression1Expression2Difference
    setPropertysetNegatedMETHOD_INVOCATION_NAME_MISMATCH
    rpassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.ReportPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText())assertion.setNegated(xpath.isNegated())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) is a void method call, and thus it cannot be parameterized
    Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) is a void method call, and thus it cannot be parameterized
    Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    4
    assertion.setNegated(xpath.isNegated());
    6
    rp.setBasedir(baseDir.getFilename());
    6
    rp.setBasedir(baseDir.getFilename());
    5
    assertion.setXPathString(xpath.getXPath());
    Differences
    Expression1Expression2Difference
    setBasedirsetXPathStringMETHOD_INVOCATION_NAME_MISMATCH
    getFilenamegetXPathMETHOD_INVOCATION_NAME_MISMATCH
    baseDirxpathVARIABLE_NAME_MISMATCH
    org.apache.jmeter.gui.util.DirectoryPanelorg.apache.jmeter.assertions.gui.XPathPanelSUBCLASS_TYPE_MISMATCH
    rpassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.ReportPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression rp.setBasedir(baseDir.getFilename()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setXPathString(xpath.getXPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rp.setBasedir(baseDir.getFilename()) is a void method call, and thus it cannot be parameterized
    Expression assertion.setXPathString(xpath.getXPath()) is a void method call, and thus it cannot be parameterized
    5
    assertion.setXPathString(xpath.getXPath());
                                                                            
    6
    xml.modifyTestElement(assertion);
    Precondition Violations (13)
    Row Violation
    1Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) is a void method call, and thus it cannot be parameterized
    4Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    5Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression rp.setProperty(ReportPlan.COMMENTS,commentPanel.getText()) is a void method call, and thus it cannot be parameterized
    8Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    9Expression rp.setBasedir(baseDir.getFilename()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertion.setXPathString(xpath.getXPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression rp.setBasedir(baseDir.getFilename()) is a void method call, and thus it cannot be parameterized
    12Expression assertion.setXPathString(xpath.getXPath()) is a void method call, and thus it cannot be parameterized
    13Clone fragment #1 returns variable rp with type org.apache.jmeter.testelement.ReportPlan , while Clone fragment #2 returns variable assertion with type org.apache.jmeter.assertions.XPathAssertion