super.configureTestElement(element); TestAction ta = (TestAction) element; ta.setAction(action); ta.setTarget(target); ta.setDuration(durationString);
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/sampler/gui/TestActionGui.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: 5 Number of AST nodes: 5
1
super.configureTestElement(element);
2
		TestAction ta = (TestAc
1
if (el instanceof XPathAssertion) {
3
tion) element;
2
			XPathAssertion assertion = (XPathAssertion) el
4
		ta.setAction(action);
5
		ta.setTarget(target
3
;
4
			assertion.setNegated(xpath.isNegated());
6
);
5
			assertion.setXPathString(xpath.getXPath());
7
		ta.setDuration(durationString);
6
			xml.modifyTestElement(assertion);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    super.configureTestElement(element);
    1
    super.configureTestElement(element);
    4
    assertion.setNegated(xpath.isNegated());
    Differences
    Expression1Expression2Difference
    super.configureTestElement(element)assertion.setNegated(xpath.isNegated())TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression super.configureTestElement(element) 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());
    2
    TestAction ta = (TestAction)element;
    2
    TestAction ta = (TestAction)element;
    3
    XPathAssertion assertion = (XPathAssertion)el;
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.sampler.TestActionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    taassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.sampler.TestActionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.sampler.TestActionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    elementelVARIABLE_NAME_MISMATCH
    3
    XPathAssertion assertion = (XPathAssertion)el;
    3
    ta.setAction(action);
                                                    
    4
    ta.setTarget(target);
                                                    
    5
    ta.setDuration(durationString);
    5
    ta.setDuration(durationString);
    5
    assertion.setXPathString(xpath.getXPath());
    Differences
    Expression1Expression2Difference
    setDurationsetXPathStringMETHOD_INVOCATION_NAME_MISMATCH
    durationStringxpath.getXPath()TYPE_COMPATIBLE_REPLACEMENT
    taassertionVARIABLE_NAME_MISMATCH
    org.apache.jmeter.sampler.TestActionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression ta.setDuration(durationString) 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 ta.setDuration(durationString) 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 (8)
    Row Violation
    1Expression assertion.setNegated(xpath.isNegated()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression super.configureTestElement(element) is a void method call, and thus it cannot be parameterized
    3Expression assertion.setNegated(xpath.isNegated()) is a void method call, and thus it cannot be parameterized
    4Expression ta.setDuration(durationString) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression assertion.setXPathString(xpath.getXPath()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ta.setDuration(durationString) is a void method call, and thus it cannot be parameterized
    7Expression assertion.setXPathString(xpath.getXPath()) is a void method call, and thus it cannot be parameterized
    8Clone fragment #1 returns variable ta with type org.apache.jmeter.sampler.TestAction , while Clone fragment #2 returns variable assertion with type org.apache.jmeter.assertions.XPathAssertion