check(); if (!isMatched()) return getRuntime().getNil(); return RubyFixnum.newFixnum(getRuntime(), end - beg);
check(); if (!isMatched()) return getRuntime().getNil(); return extractRange(context.getRuntime(), lastPos + beg, lastPos + end);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyStringScanner.java File path: /jruby-1.4.0/src/org/jruby/RubyStringScanner.java
Method name: IRubyObject matched_size() Method name: IRubyObject matched(ThreadContext)
Number of AST nodes: 4 Number of AST nodes: 4
1
check();
1
check();
2
        if (!isMatched()) return getRuntime().getNil();
2
        if (!isMatched()) return getRuntime().getNil(); 
3
        return RubyFixnum.newFixnum(getRuntime(), end - beg);
3
        return extractRange(context.getRuntime(), lastPos + beg, lastPos + end);
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.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    check();
    1
    check();
    2
    if (!isMatched())
    2
    if (!isMatched())
    3
    return getRuntime().getNil();
    3
    return getRuntime().getNil();
                                                                                                                                                      
    4
    return extractRange(context.getRuntime(), lastPos + beg, lastPos + end);
    Preondition Violations
    Unmatched return extractRange(context.getRuntime(),lastPos + beg,lastPos + end);
    4
    return extractRange(context.getRuntime(), lastPos + beg, lastPos + end);
    4
    return RubyFixnum.newFixnum(getRuntime(), end - beg);
    4
    return RubyFixnum.newFixnum(getRuntime(), end - beg);
    Preondition Violations
    Unmatched return RubyFixnum.newFixnum(getRuntime(),end - beg);
                                                                                                                  
    Precondition Violations (2)
    Row Violation
    1Unmatched return extractRange(context.getRuntime(),lastPos + beg,lastPos + end);
    2Unmatched return RubyFixnum.newFixnum(getRuntime(),end - beg);