if (te instanceof TestPlan || te instanceof WorkBench) { name.append(cur.getName()); name.append(seperator); buildNodesModel(cur, name.toString(), 0); }
if (doc == null || doc.getDocumentElement() == null) { result.setError(true); result.setFailureMessage("Document is null, probably not parsable"); return result; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/ModuleControllerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/XPathAssertion.java
Method name: void buildNodesModel(JMeterTreeNode, String, int) Method name: AssertionResult getResult(SampleResult)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (te instanceof TestPlan || te instanceof WorkBench) {
1
if (
2
					name.append(cur.getName());
3
					name.append(seperator);
4
					buildNodesModel(cur, name.toString(), 0)
2
doc == null || doc.getDocumentElement() == null) {
3
			result.setError(true);
4
			result.setFailureMessage("Document is null, probably not parsable");
5
;
5
			return result;
6
				}
6
		}
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
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    24
    if (te instanceof TestPlan || te instanceof WorkBench)
    24
    if (te instanceof TestPlan || te instanceof WorkBench)
    15
    if (doc == null || doc.getDocumentElement() == null)
    Differences
    Expression1Expression2Difference
    te instanceof TestPlandoc == nullINFIX_LEFT_OPERAND_MISMATCH
    te instanceof WorkBenchdoc.getDocumentElement() == nullINFIX_RIGHT_OPERAND_MISMATCH
    15
    if (doc == null || doc.getDocumentElement() == null)
                                                        
    16
    result.setError(true);
                                        
    18
    return result;
    Preondition Violations
    Unmatched return result;
    18
    return result;
    25
    name.append(cur.getName());
    25
    name.append(cur.getName());
    Preondition Violations
    Unmatched statement name.append(cur.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                  
    26
    name.append(seperator);
                                                          
    27
    buildNodesModel(cur, name.toString(), 0);
    27
    buildNodesModel(cur, name.toString(), 0);
    17
    result.setFailureMessage("Document is null, probably not parsable");
    Differences
    Expression1Expression2Difference
    buildNodesModelsetFailureMessageMETHOD_INVOCATION_NAME_MISMATCH
    buildNodesModel(cur,name.toString(),0)result.setFailureMessage("Document is null, probably not parsable")ARGUMENT_NUMBER_MISMATCH
    resultMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression buildNodesModel(cur,name.toString(),0) is a void method call, and thus it cannot be parameterized
    Expression result.setFailureMessage("Document is null, probably not parsable") is a void method call, and thus it cannot be parameterized
    Expression buildNodesModel(cur,name.toString(),0) is a void method call, and thus it cannot be parameterized
    Expression result.setFailureMessage("Document is null, probably not parsable") is a void method call, and thus it cannot be parameterized
    17
    result.setFailureMessage("Document is null, probably not parsable");
    Precondition Violations (6)
    Row Violation
    1Unmatched return result;
    2Unmatched statement name.append(cur.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression buildNodesModel(cur,name.toString(),0) is a void method call, and thus it cannot be parameterized
    4Expression result.setFailureMessage("Document is null, probably not parsable") is a void method call, and thus it cannot be parameterized
    5Expression buildNodesModel(cur,name.toString(),0) is a void method call, and thus it cannot be parameterized
    6Expression result.setFailureMessage("Document is null, probably not parsable") is a void method call, and thus it cannot be parameterized