if (decLength > 0) {
if (decZeroes > 0) {
buf.fill('0',decZeroes);
precision -= decZeroes;
}
if (decDigits > 0) {
buf.append(digits,intDigits,decDigits);
precision -= decDigits;
}
if ((flags & FLAG_SHARP) != 0 && precision > 0) {
buf.fill('0',precision);
}
}
if (precision > 0) {
if (decZeroes > 0) {
buf.fill('0',decZeroes);
precision -= decZeroes;
}
if (decDigits > 0) {
buf.append(digits,intDigits,decDigits);
precision -= decDigits;
}
// fill up the rest with zeroes
if (precision > 0) {
buf.fill('0',precision);
}
}
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: 9
|
|
Number of AST nodes: 9
|
|
1 | if (decLength > 0) {↵ | | 1 | if (precision > 0) {↵
|
2 | if (decZeroes > 0) {↵ | | 2 | if (decZeroes > 0) {↵
|
3 | buf.fill('0',decZeroes);↵ | | 3 | buf.fill('0',decZeroes);↵
|
4 | precision -= decZeroes;↵ | | 4 | precision -= decZeroes;↵
|
5 | }↵ | | 5 | ↵
|
6 | ↵ | | 6 | }↵
|
7 | if (decDigits > 0) {↵ | | 7 | if (decDigits > 0) {↵
|
8 | buf.append(digits,intDigits,decDigits);↵ | | 8 | buf.append(digits,intDigits,decDigits);↵
|
9 | precision -= decDigits;↵ | | 9 | precision -= decDigits;↵
|
10 | }↵ | | 10 | }↵
|
11 | if ((flags & FLAG_SHARP) != 0 && ↵ | | 11 | // fill up the rest with zeroes↵
|
12 | precision > 0) {↵ | | 12 | if (precision > 0) {↵
|
13 | buf.fill('0',precision);↵ | | 13 | buf.fill('0',precision);↵
|
14 | }↵ | | 14 | ↵
|
15 | ↵ | | 15 | }↵
|
16 | } | | 16 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.8 |
Clones location | Clones are in the same method |
Number of node comparisons | 42 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 15.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
585 | if (decLength > 0) | | 642 | if (precision > 0) |
586 | | | 643 | |
587 | buf.fill('0', decZeroes); | | 644 | buf.fill('0', decZeroes); |
588 | | | 645 | |
589 | | | 646 | |
590 | buf.append(digits, intDigits, decDigits); | | 647 | buf.append(digits, intDigits, decDigits); |
591 | | | 648 | |
Precondition Violations (1)
Row |
Violation |
1 | Expression precision cannot be parameterized, because it has dependencies to/from statements that will be extracted |