for (;; c = src.read()) { if (c == '_') { if (nondigit != '\0') break; nondigit = c; } else if (c >= '0' && c <= '7') { 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 (c >= '0' && c <= '7') {
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
                    }
12
                        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in the same method
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    86
    if (nondigit != '\0')
    38
    if (nondigit != '\0')
    87
    break;
    87
    break;
    39
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    39
    break;
    Precondition Violations (2)
    Row Violation
    1Statement break; without innermost loop
    2Statement break; without innermost loop