super.configureTestElement(plan); if (plan instanceof TestPlan) { TestPlan tp = (TestPlan) plan; tp.setFunctionalMode(functionalMode.isSelected()); tp.setSerialized(serializedMode.isSelected()); tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement()); tp.setTestPlanClasspathArray(browseJar.getFiles()); }
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/TestPlanGui.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: 7 Number of AST nodes: 6
1
super.configureTestElement(plan);
1
super.configureTestElement(el);
2
		if (plan instanceof TestPlan) {
2
		if (el instanceof 
3
			TestPlan tp = (TestPlan) plan;
4
			tp.setFunctionalMode(functionalMode.isSelected());
5
			tp.setSerialized(serializedMode.isSelected());
6
			tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement());
7
            tp.setTestPlanClasspathArray(browseJar.getFiles()
3
XPathAssertion) {
4
			XPathAssertion assertion = (XPathAssertion) el;
5
			assertion.setNegated(xpath.isNegated());
6
			assertion.setXPathString(xpath.getXPath());
8
);
7
			xml.modifyTestElement(assertion);
9
		}
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 comparisons31
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.5
    Clone typeType 3
    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 TestPlan)
    2
    if (plan instanceof TestPlan)
    2
    if (el instanceof XPathAssertion)
    Differences
    Expression1Expression2Difference
    planelVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.TestPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    2
    if (el instanceof XPathAssertion)
    3
    TestPlan tp = (TestPlan)plan;
    3
    TestPlan tp = (TestPlan)plan;
    3
    XPathAssertion assertion = (XPathAssertion)el;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.testelement.TestPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    tpassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.TestPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.testelement.TestPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    planelVARIABLE_NAME_MISMATCH
    3
    XPathAssertion assertion = (XPathAssertion)el;
    4
    tp.setFunctionalMode(functionalMode.isSelected());
    4
    tp.setFunctionalMode(functionalMode.isSelected());
    4
    assertion.setNegated(xpath.isNegated());
    Differences
    Expression1Expression2Difference
    setFunctionalModesetNegatedMETHOD_INVOCATION_NAME_MISMATCH
    isSelectedisNegatedMETHOD_INVOCATION_NAME_MISMATCH
    functionalModexpathVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxorg.apache.jmeter.assertions.gui.XPathPanelSUBCLASS_TYPE_MISMATCH
    tpassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.TestPlanorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tp.setFunctionalMode(functionalMode.isSelected()) 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 tp.setFunctionalMode(functionalMode.isSelected()) 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());
                                                                                                
    5
    assertion.setXPathString(xpath.getXPath());
    5
    tp.setSerialized(serializedMode.isSelected());
                                                                                                      
                                                                            
    6
    xml.modifyTestElement(assertion);
    6
    tp.setUserDefinedVariables((Arguments)argsPanel.createTestElement());
                                                                                                                                                    
    7
    tp.setTestPlanClasspathArray(browseJar.getFiles());
                                                                                                                
    Precondition Violations (5)
    Row Violation
    1Expression tp.setFunctionalMode(functionalMode.isSelected()) 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 tp.setFunctionalMode(functionalMode.isSelected()) 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
    5Clone fragment #1 returns variable tp with type org.apache.jmeter.testelement.TestPlan , while Clone fragment #2 returns variable assertion with type org.apache.jmeter.assertions.XPathAssertion