if (ASCII.isDigit(next)) {
occurrences = 0;
do {
occurrences = occurrences * 10 + Character.digit((char)(next & 0xFF), 10);
next = safeGet(format);
} while (next != 0 && ASCII.isDigit(next));
}
occurrences = 0;
do {
occurrences = occurrences * 10 + Character.digit((char)(next & 0xFF), 10);
next = safeGet(format);
} while (next != 0 && ASCII.isDigit(next));
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/Pack.java
|
|
File path: /jruby-1.4.0/src/org/jruby/util/Pack.java
|
Method name: RubyString pack(Ruby, RubyArray, ByteList)
|
|
Method name: RubyArray unpack(Ruby, ByteList, ByteList)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (ASCII.isDigit(next)) {↵ | | |
|
2 | occurrences = 0;↵ | | 1 | occurrences = 0;↵
|
3 | do {↵ | | 2 | do {↵
|
4 | occurrences = occurrences * 10 + Character.digit((char)(next & 0xFF), 10);↵ | | 3 | occurrences = occurrences * 10 + Character.digit((char)(next & 0xFF), 10);↵
|
5 | next = safeGet(format);↵ | | 4 | next = safeGet(format);↵
|
6 | } while (next != 0 && ASCII.isDigit(next));↵ | | 5 | } while (next != 0 && ASCII.isDigit(next));
|
7 | } | | | |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 66 |
-
{Non-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) | 8.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
39 | occurrences = 0; | | 22 | occurrences = 0; |
42 | do while(next != 0 && ASCII.isDigit(next)) | | 25 | do while(next != 0 && ASCII.isDigit(next)) |
40 | occurrences = occurrences * 10 + Character.digit((char)(next & 0xFF), 10); | | 23 | occurrences = occurrences * 10 + Character.digit((char)(next & 0xFF), 10); |
41 | | | 24 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables next, occurrences , while Clone fragment #2 returns variables next, occurrences |