RubyRange range = new RubyRange(runtime, runtime.getRange()); range.init(context, begin, end, true); return range;
if (isRequireable(loc)) { LoadServiceResource foundResource = new LoadServiceResource(loc, loc.getPath()); debugLogFound(foundResource); return foundResource; }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyRange.java File path: /jruby-1.4.0/src/org/jruby/runtime/load/LoadService.java
Method name: RubyRange newExclusiveRange(Ruby, ThreadContext, IRubyObject, IRubyObject) Method name: LoadServiceResource findFileInClasspath(String)
Number of AST nodes: 3 Number of AST nodes: 4
1
RubyRange range = new RubyRange(runtime, runtime.getRange());
2
        range.init(context, begin, end, true);
3
        return range;
1
if (isRequireable(loc)) {
2
            LoadServiceResource foundResource = new LoadServiceResource(loc, loc.getPath());
3
            debugLogFound(foundResource);
4
            return foundResource;
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.0
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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyRange range = new RubyRange(runtime, runtime.getRange());
                                                                                                                              
                                                                                                                                                                      
    21
    LoadServiceResource foundResource = new LoadServiceResource(loc, loc.getPath());
    2
    range.init(context, begin, end, true);
    2
    range.init(context, begin, end, true);
    22
    debugLogFound(foundResource);
    Differences
    Expression1Expression2Difference
    initdebugLogFoundMETHOD_INVOCATION_NAME_MISMATCH
    range.init(context,begin,end,true)debugLogFound(foundResource)ARGUMENT_NUMBER_MISMATCH
    rangeMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    Expression debugLogFound(foundResource) is a void method call, and thus it cannot be parameterized
    Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    Expression debugLogFound(foundResource) is a void method call, and thus it cannot be parameterized
    22
    debugLogFound(foundResource);
    3
    return range;
    3
    return range;
    Preondition Violations
    Unmatched return range;
                                    
                                                      
    23
    return foundResource;
    Preondition Violations
    Unmatched return foundResource;
    23
    return foundResource;
    Precondition Violations (6)
    Row Violation
    1Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    2Expression debugLogFound(foundResource) is a void method call, and thus it cannot be parameterized
    3Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    4Expression debugLogFound(foundResource) is a void method call, and thus it cannot be parameterized
    5Unmatched return range;
    6Unmatched return foundResource;