while (t + tlen >= max) { max <<= 1; byte[]tbuf = new byte[max]; System.arraycopy(buf, 0, tbuf, 0, buf.length); buf = tbuf; }
while (t + tlen >= max) { max <<= 1; byte[]tbuf = new byte[max]; System.arraycopy(buf, 0, tbuf, 0, buf.length); buf = tbuf; }
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 trTrans19(ThreadContext, IRubyObject, IRubyObject, boolean) Method name: IRubyObject trTrans19(ThreadContext, IRubyObject, IRubyObject, boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
while (t + tlen >= max) {
1
while (t + tlen >= max) {
2
                    max <<= 1;
2
                    max <<= 1;
3
                    byte[]tbuf = new byte[max];
3
                    byte[]tbuf = new byte[max];
4
                    System.arraycopy(buf, 0, tbuf, 0, buf.length);
4
                    System.arraycopy(buf, 0, tbuf, 0, buf.length);
5
                    buf = tbuf;
5
                    buf = tbuf;
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.3
Clones locationClones are in the same method
Number of node comparisons28
  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.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    132
    while (t + tlen >= max)
    92
    while (t + tlen >= max)
    133
    max <<= 1;
    93
    max <<= 1;
    134
    byte[] tbuf = new byte[max];
    94
    byte[] tbuf = new byte[max];
    135
    System.arraycopy(buf, 0, tbuf, 0, buf.length);
    95
    System.arraycopy(buf, 0, tbuf, 0, buf.length);
    136
    buf = tbuf;
    96
    buf = tbuf;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables buf, max , while Clone fragment #2 returns variables buf, max