if (isHexChar(c)) {
for (;; c = src.read()) {
if (c == '_') {
if (nondigit != '\0') break;
nondigit = c;
} else if (isHexChar(c)) {
nondigit = '\0';
tokenBuffer.append((char) c);
} else {
break;
}
}
}
if (c == '0' || c == '1') {
for (;; c = src.read()) {
if (c == '_') {
if (nondigit != '\0') break;
nondigit = c;
} else if (c == '0' || c == '1') {
nondigit = '\0';
tokenBuffer.append((char) c);
} else {
break;
}
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/lexer/yacc/RubyYaccLexer.java
|
|
File path: /jruby-1.4.0/src/org/jruby/lexer/yacc/RubyYaccLexer.java
|
Method name: int parseNumber(int)
|
|
Method name: int parseNumber(int)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | if (isHexChar(c)) {↵ | | 1 | if (c == '0' || c == '1') {↵
|
2 | for (;; c = src.read()) {↵ | | 2 | for (;; c = src.read()) {↵
|
3 | if (c == '_') {↵ | | 3 | if (c == '_') {↵
|
4 | if (nondigit != '\0') break;↵ | | 4 | if (nondigit != '\0') break;↵
|
5 | nondigit = c;↵ | | 5 | nondigit = c;↵
|
6 | } else if (isHexChar(c)) {↵ | | 6 | } else if (c == '0' || c == '1') {↵
|
7 | nondigit = '\0';↵ | | 7 | nondigit = '\0';↵
|
8 | tokenBuffer.append((char) c);↵ | | 8 | tokenBuffer.append((char) c);↵
|
9 | } else {↵ | | 9 | } else {↵
|
10 | break;↵ | | 10 | break;↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
13 | } | | 13 | }
|
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 1.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | if (nondigit != '\0') | | 38 | if (nondigit != '\0') |
19 | | | 39 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |