if (intDigits > 0) { // s/b true, since intLength > 0 buf.append(digits,0,intDigits); } if (intZeroes > 0) { buf.fill('0',intZeroes); }
if (intDigits > 0) { // s/b true, since intLength > 0 buf.append(digits,0,intDigits); } if (intZeroes > 0) { buf.fill('0',intZeroes); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/Sprintf.java File path: /jruby-1.4.0/src/org/jruby/util/Sprintf.java
Method name: boolean rubySprintfToBuffer(ByteList, CharSequence, Args, boolean) Method name: boolean rubySprintfToBuffer(ByteList, CharSequence, Args, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (intDigits > 0) { // s/b true, since intLength > 0
1
if (intDigits > 0) { // s/b true, since intLength > 0
2
                                    buf.append(digits,0,intDigits);
2
                                buf.append(digits,0,intDigits);
3
                                }
3
                            
4
  
4
}
5
                              if (intZeroes > 0) {
5
                            if (intZeroes > 0) {
6
                                    buf.fill('0',intZeroes);
6
                                buf.fill('0',intZeroes);
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.4
Clones locationClones are in the same method
Number of node comparisons19
  1. {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.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    578
    if (intDigits > 0)
    635
    if (intDigits > 0)
    579
    buf.append(digits, 0, intDigits);
    636
    buf.append(digits, 0, intDigits);
    580
    if (intZeroes > 0)
    637
    if (intZeroes > 0)
    581
    buf.fill('0', intZeroes);
    638
    buf.fill('0', intZeroes);
    Precondition Violations (0)
    Row Violation