NodeList opnodes = one.getElementsByTagName("operation"); String soapOp = "soap:operation"; if (opnodes.getLength() == 0) { opnodes = one.getElementsByTagName("wsdl:operation"); } if (one.getElementsByTagName(soapOp).getLength() == 0) { soapOp = "wsdlsoap:operation"; }
NodeList bindings = WSDLDOC.getElementsByTagName("binding"); String soapBind = "soap:binding"; if (bindings.getLength() == 0) { bindings = WSDLDOC.getElementsByTagName("wsdl:binding"); } if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0) { soapBind = "wsdlsoap:binding"; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/WSDLHelper.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/WSDLHelper.java
Method name: Object[] getOperations() Method name: Object[] getSOAPBindings()
Number of AST nodes: 6 Number of AST nodes: 6
1
NodeList opnodes = one.getElementsByTagName("operation");
1
NodeList bindings = WSDLDOC.getElementsByTagName("binding");
2
			String soapOp = "soap:operation";
2
		String soapBind = "soap:binding";
3
			if (opnodes.getLength() == 0) {
3
		if (bindings.getLength() == 0) {
4
				opnodes = one.getElementsByTagName("wsdl:operation");
4
			bindings = WSDLDOC.getElementsByTagName("wsdl:binding");
5
			}
5
		}
6
			if (one.getElementsByTagName(soapOp).getLength() == 0) {
6
		if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0) {
7
				soapOp = "wsdlsoap:operation";
7
			soapBind = "wsdlsoap:binding";
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.5
Clones locationClones are declared in the same class
Number of node comparisons18
  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)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    NodeList opnodes = one.getElementsByTagName("operation");
    5
    NodeList opnodes = one.getElementsByTagName("operation");
    2
    NodeList bindings = WSDLDOC.getElementsByTagName("binding");
    Differences
    Expression1Expression2Difference
    opnodesbindingsVARIABLE_NAME_MISMATCH
    "operation""binding"LITERAL_VALUE_MISMATCH
    oneWSDLDOCVARIABLE_NAME_MISMATCH
    org.w3c.dom.Elementorg.w3c.dom.DocumentSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression one cannot be unified with expression WSDLDOC , because common superclass org.w3c.dom.Node does not declare member(s) public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String)
    2
    NodeList bindings = WSDLDOC.getElementsByTagName("binding");
                                                                        
    3
    String soapBind = "soap:binding";
    6
    String soapOp = "soap:operation";
    6
    String soapOp = "soap:operation";
    Preondition Violations
    Unmatched statement String soapOp="soap:operation"; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
    7
    if (opnodes.getLength() == 0)
    7
    if (opnodes.getLength() == 0)
    4
    if (bindings.getLength() == 0)
    Differences
    Expression1Expression2Difference
    opnodesbindingsVARIABLE_NAME_MISMATCH
    4
    if (bindings.getLength() == 0)
    8
    opnodes = one.getElementsByTagName("wsdl:operation");
    8
    opnodes = one.getElementsByTagName("wsdl:operation");
    5
    bindings = WSDLDOC.getElementsByTagName("wsdl:binding");
    Differences
    Expression1Expression2Difference
    opnodesbindingsVARIABLE_NAME_MISMATCH
    "wsdl:operation""wsdl:binding"LITERAL_VALUE_MISMATCH
    oneWSDLDOCVARIABLE_NAME_MISMATCH
    org.w3c.dom.Elementorg.w3c.dom.DocumentSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression one cannot be unified with expression WSDLDOC , because common superclass org.w3c.dom.Node does not declare member(s) public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String)
    5
    bindings = WSDLDOC.getElementsByTagName("wsdl:binding");
    9
    if (one.getElementsByTagName(soapOp).getLength() == 0)
    9
    if (one.getElementsByTagName(soapOp).getLength() == 0)
    6
    if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0)
    Differences
    Expression1Expression2Difference
    soapOpsoapBindVARIABLE_NAME_MISMATCH
    oneWSDLDOCVARIABLE_NAME_MISMATCH
    org.w3c.dom.Elementorg.w3c.dom.DocumentSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression one cannot be unified with expression WSDLDOC , because common superclass org.w3c.dom.Node does not declare member(s) public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String)
    6
    if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0)
    10
    soapOp = "wsdlsoap:operation";
    10
    soapOp = "wsdlsoap:operation";
    7
    soapBind = "wsdlsoap:binding";
    Differences
    Expression1Expression2Difference
    soapOpsoapBindVARIABLE_NAME_MISMATCH
    "wsdlsoap:operation""wsdlsoap:binding"LITERAL_VALUE_MISMATCH
    7
    soapBind = "wsdlsoap:binding";
    Precondition Violations (5)
    Row Violation
    1Expression one cannot be unified with expression WSDLDOC , because common superclass org.w3c.dom.Node does not declare member(s) public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String)
    2Unmatched statement String soapOp="soap:operation"; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression one cannot be unified with expression WSDLDOC , because common superclass org.w3c.dom.Node does not declare member(s) public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String)
    4Expression one cannot be unified with expression WSDLDOC , because common superclass org.w3c.dom.Node does not declare member(s) public abstract org.w3c.dom.NodeList getElementsByTagName(java.lang.String)
    5Clone fragment #1 returns variables opnodes, soapOp , while Clone fragment #2 returns variables soapBind, bindings