if (bshInterpreter == null) { result.setFailure(true); result.setError(true); result.setFailureMessage("BeanShell Interpreter not found"); return result; }
if (mgr == null) { result.setFailure(true); result.setError(true); result.setFailureMessage("BSF Manager not found"); return result; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/BeanShellAssertion.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/BSFAssertion.java
Method name: AssertionResult getResult(SampleResult) Method name: AssertionResult getResult(SampleResult)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (bshInterpreter == null) {
1
if (mgr == null) {
2
			result.setFailure(true);
2
                result.setFailure(true);
3
			result.setError(true);
3
                result.setError(true);
4
			result.setFailureMessage("BeanShell Interpreter not found");
4
                result.setFailureMessage("BSF Manager not found");
5
			return result;
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (bshInterpreter == null)
    3
    if (bshInterpreter == null)
    4
    if (mgr == null)
    Differences
    Expression1Expression2Difference
    bshInterpretermgrVARIABLE_NAME_MISMATCH
    org.apache.jmeter.util.BeanShellInterpreterorg.apache.bsf.BSFManagerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.util.BeanShellInterpreter of variable bshInterpreter does not match with type org.apache.bsf.BSFManager of variable mgr
    • Make classes org.apache.jmeter.util.BeanShellInterpreter and org.apache.bsf.BSFManager extend a common superclass
    4
    if (mgr == null)
    4
    result.setFailure(true);
    5
    result.setFailure(true);
    5
    result.setError(true);
    6
    result.setError(true);
    6
    result.setFailureMessage("BeanShell Interpreter not found");
    6
    result.setFailureMessage("BeanShell Interpreter not found");
    7
    result.setFailureMessage("BSF Manager not found");
    Differences
    Expression1Expression2Difference
    "BeanShell Interpreter not found""BSF Manager not found"LITERAL_VALUE_MISMATCH
    7
    result.setFailureMessage("BSF Manager not found");
    7
    return result;
    8
    return result;
    Precondition Violations (2)
    Row Violation
    1Type org.apache.jmeter.util.BeanShellInterpreter of variable bshInterpreter does not match with type org.apache.bsf.BSFManager of variable mgr
    2Not all possible execution flows end in a return statement