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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 19 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.7 |
Clone type | Type 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 |