if (expr instanceof File) { jExpr = ScriptFactory.createScript((File) expr); } else if (expr instanceof URL) { jExpr = ScriptFactory.createScript((URL) expr); } else { jExpr = ScriptFactory.createScript((String) expr); }
if (script instanceof File) { jExpr = ScriptFactory.createScript((File) script); } else if (script instanceof URL) { jExpr = ScriptFactory.createScript((URL) script); } else { jExpr = ScriptFactory.createScript((String) script); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/commons/jexl/bsf/JexlEngine.java File path: /jakarta-jmeter-2.3.2/src/org/apache/commons/jexl/bsf/JexlEngine.java
Method name: Object eval(String, int, int, Object) Method name: void exec(String, int, int, Object)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (expr instanceof File) {
1
if (script instanceof File) {
2
                jExpr = ScriptFactory.createScript((File) expr);
2
                jExpr = ScriptFactory.createScript((File) script);
3
            } else if (expr instanceof URL) {
3
            } else if (script instanceof URL) {
4
                jExpr = ScriptFactory.createScript((URL) expr);
4
                jExpr = ScriptFactory.createScript((URL) script);
5
            } else {
5
            } else {
6
                jExpr = ScriptFactory.createScript((String) expr);
6
                jExpr = ScriptFactory.createScript((String) script);
7
            }
7
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {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)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (expr instanceof File)
    5
    if (expr instanceof File)
    5
    if (script instanceof File)
    Differences
    Expression1Expression2Difference
    exprscriptVARIABLE_NAME_MISMATCH
    5
    if (script instanceof File)
    6
    jExpr = ScriptFactory.createScript((File)expr);
    6
    jExpr = ScriptFactory.createScript((File)expr);
    6
    jExpr = ScriptFactory.createScript((File)script);
    Differences
    Expression1Expression2Difference
    exprscriptVARIABLE_NAME_MISMATCH
    6
    jExpr = ScriptFactory.createScript((File)script);
    7
    else if (expr instanceof URL)
    7
    else if (expr instanceof URL)
    7
    else if (script instanceof URL)
    Differences
    Expression1Expression2Difference
    exprscriptVARIABLE_NAME_MISMATCH
    7
    else if (script instanceof URL)
    8
    jExpr = ScriptFactory.createScript((URL)expr);
    8
    jExpr = ScriptFactory.createScript((URL)expr);
    8
    jExpr = ScriptFactory.createScript((URL)script);
    Differences
    Expression1Expression2Difference
    exprscriptVARIABLE_NAME_MISMATCH
    8
    jExpr = ScriptFactory.createScript((URL)script);
    else
    else
    9
    jExpr = ScriptFactory.createScript((String)expr);
    9
    jExpr = ScriptFactory.createScript((String)expr);
    9
    jExpr = ScriptFactory.createScript((String)script);
    Differences
    Expression1Expression2Difference
    exprscriptVARIABLE_NAME_MISMATCH
    9
    jExpr = ScriptFactory.createScript((String)script);
    Precondition Violations (0)
    Row Violation