for (;; c = src.read()) {
if (c == '_') {
if (nondigit != '\0') break;
nondigit = c;
} else if (Character.isDigit(c)) {
nondigit = '\0';
tokenBuffer.append((char) c);
} else {
break;
}
}
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: 9
|
|
Number of AST nodes: 9
|
|
1 | for (;; c = src.read()) {↵ | | 1 | for (;; c = src.read()) {↵
|
2 | if (c == '_') {↵ | | 2 | if (c == '_') {↵
|
3 | if (nondigit != '\0') break;↵ | | 3 | if (nondigit != '\0') break;↵
|
4 | nondigit = c;↵ | | 4 | nondigit = c;↵
|
5 | } else if (Character.isDigit(c)) {↵ | | 5 | } else if (c == '0' || c == '1') {↵
|
6 | nondigit = '\0';↵ | | 6 | nondigit = '\0';↵
|
7 | tokenBuffer.append((char) c);↵ | | 7 | tokenBuffer.append((char) c);↵
|
8 | } else {↵ | | 8 | } else {↵
|
9 | break;↵ | | 9 | break;↵
|
10 | }↵ | | 10 | }↵
|
11 | } | | 11 | }
|
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.3 |
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.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
58 | if (nondigit != '\0') | | 38 | if (nondigit != '\0') |
59 | | | 39 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |