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 comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                              
    2
    NodeList bindings = WSDLDOC.getElementsByTagName("binding");
    5
    NodeList opnodes = one.getElementsByTagName("operation");
    5
    NodeList opnodes = one.getElementsByTagName("operation");
    Preondition Violations
    Unmatched statement NodeList opnodes=one.getElementsByTagName("operation"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                        
    6
    String soapOp = "soap:operation";
    6
    String soapOp = "soap:operation";
    3
    String soapBind = "soap:binding";
    Differences
    Expression1Expression2Difference
    soapOpsoapBindVARIABLE_NAME_MISMATCH
    "soap:operation""soap:binding"LITERAL_VALUE_MISMATCH
    3
    String soapBind = "soap:binding";
    7
    if (opnodes.getLength() == 0)
    7
    if (opnodes.getLength() == 0)
    6
    if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0)
    Differences
    Expression1Expression2Difference
    opnodesWSDLDOC.getElementsByTagName(soapBind)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression WSDLDOC.getElementsByTagName(soapBind) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (WSDLDOC.getElementsByTagName(soapBind).getLength() == 0)
                                                                  
    7
    soapBind = "wsdlsoap:binding";
    8
    opnodes = one.getElementsByTagName("wsdl:operation");
    8
    opnodes = one.getElementsByTagName("wsdl:operation");
    Preondition Violations
    Unmatched statement opnodes=one.getElementsByTagName("wsdl:operation"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                
    9
    if (one.getElementsByTagName(soapOp).getLength() == 0)
    9
    if (one.getElementsByTagName(soapOp).getLength() == 0)
    4
    if (bindings.getLength() == 0)
    Differences
    Expression1Expression2Difference
    one.getElementsByTagName(soapOp)bindingsTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression one.getElementsByTagName(soapOp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    if (bindings.getLength() == 0)
                                                                                                                      
    5
    bindings = WSDLDOC.getElementsByTagName("wsdl:binding");
    Preondition Violations
    Unmatched statement bindings=WSDLDOC.getElementsByTagName("wsdl:binding"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    bindings = WSDLDOC.getElementsByTagName("wsdl:binding");
    10
    soapOp = "wsdlsoap:operation";
    10
    soapOp = "wsdlsoap:operation";
    Preondition Violations
    Unmatched statement soapOp="wsdlsoap:operation"; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                    
    Precondition Violations (6)
    Row Violation
    1Unmatched statement NodeList opnodes=one.getElementsByTagName("operation"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression WSDLDOC.getElementsByTagName(soapBind) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement opnodes=one.getElementsByTagName("wsdl:operation"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Expression one.getElementsByTagName(soapOp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement bindings=WSDLDOC.getElementsByTagName("wsdl:binding"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement soapOp="wsdlsoap:operation"; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted