if (getCompatVersion() == CompatVersion.RUBY1_8) { return new ASTCompiler(); } else { return new ASTCompiler19(); }
if (version == CompatVersion.RUBY1_8) { return new DefaultRubyParser(); } else { return new Ruby19Parser(); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyInstanceConfig.java File path: /jruby-1.4.0/src/org/jruby/parser/RubyParserPool.java
Method name: ASTCompiler newCompiler() Method name: RubyParser borrowParser(CompatVersion)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (getCompatVersion() == CompatVersion.RUBY1_8) {
1
if (version == CompatVersion.RUBY1_8) {
2
            return new ASTCompiler();
2
            return new DefaultRubyParser();
3
        } else {
3
        } else {
4
            return new ASTCompiler19();
4
            return new Ruby19Parser();
5
        }
5
        }
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.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (getCompatVersion() == CompatVersion.RUBY1_8)
    1
    if (getCompatVersion() == CompatVersion.RUBY1_8)
    1
    if (version == CompatVersion.RUBY1_8)
    Differences
    Expression1Expression2Difference
    getCompatVersion()versionTYPE_COMPATIBLE_REPLACEMENT
    1
    if (version == CompatVersion.RUBY1_8)
                                                                        
    2
    return new DefaultRubyParser();
    Preondition Violations
    Unmatched return new DefaultRubyParser();
    2
    return new DefaultRubyParser();
    2
    return new ASTCompiler();
    2
    return new ASTCompiler();
    Preondition Violations
    Unmatched return new ASTCompiler();
                                                            
    else
            
                                                              
    3
    return new Ruby19Parser();
    Preondition Violations
    Unmatched return new Ruby19Parser();
    3
    return new Ruby19Parser();
    3
    return new ASTCompiler19();
    3
    return new ASTCompiler19();
    Preondition Violations
    Unmatched return new ASTCompiler19();
                                                                
    Precondition Violations (4)
    Row Violation
    1Unmatched return new DefaultRubyParser();
    2Unmatched return new ASTCompiler();
    3Unmatched return new Ruby19Parser();
    4Unmatched return new ASTCompiler19();