for (int i=1; i<args.length; i++) { otherStr = args[i].convertToString(); enc = checkEncoding(otherStr); tables = otherStr.trSetupTable(runtime, squeeze, tables, false, enc); }
for (int i = 1; i<args.length; i++) { otherStr = args[i].convertToString(); enc = checkEncoding(otherStr); tables = otherStr.trSetupTable(runtime, table, tables, false, enc); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyString.java File path: /jruby-1.4.0/src/org/jruby/RubyString.java
Method name: IRubyObject delete_bang19(ThreadContext, IRubyObject[]) Method name: IRubyObject count19(ThreadContext, IRubyObject[])
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i=1; i<args.length; i++) {
1
for (int i = 1; i<args.length; i++) {
2
            otherStr = args[i].convertToString();
2
            otherStr = args[i].convertToString();
3
            enc = checkEncoding(otherStr);
3
            enc = checkEncoding(otherStr);
4
            tables = otherStr.trSetupTable(runtime, squeeze, tables, false, enc);
4
            tables = otherStr.trSetupTable(runtime, table, tables, false, enc);
5
        }
5
        }
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 declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    for (int i = 1; i < args.length; i++)
    8
    for (int i = 1; i < args.length; i++)
    9
    otherStr = args[i].convertToString();
    9
    otherStr = args[i].convertToString();
    10
    enc = checkEncoding(otherStr);
    10
    enc = checkEncoding(otherStr);
    11
    tables = otherStr.trSetupTable(runtime, squeeze, tables, false, enc);
    11
    tables = otherStr.trSetupTable(runtime, squeeze, tables, false, enc);
    11
    tables = otherStr.trSetupTable(runtime, table, tables, false, enc);
    Differences
    Expression1Expression2Difference
    squeezetableVARIABLE_NAME_MISMATCH
    11
    tables = otherStr.trSetupTable(runtime, table, tables, false, enc);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables enc, tables , while Clone fragment #2 returns variables enc, tables