RubyRange range = new RubyRange(runtime, runtime.getRange()); range.init(context, begin, end, isExclusive); 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 newRange(Ruby, ThreadContext, IRubyObject, IRubyObject, boolean) 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, isExclusive);
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());
                                                                                                                              
                                                                                                                                                                      
    13
    LoadServiceResource foundResource = new LoadServiceResource(loc, loc.getPath());
    Preondition Violations
    Unmatched statement LoadServiceResource foundResource=new LoadServiceResource(loc,loc.getPath()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13
    LoadServiceResource foundResource = new LoadServiceResource(loc, loc.getPath());
    2
    range.init(context, begin, end, isExclusive);
    2
    range.init(context, begin, end, isExclusive);
    14
    debugLogFound(foundResource);
    Differences
    Expression1Expression2Difference
    initdebugLogFoundMETHOD_INVOCATION_NAME_MISMATCH
    range.init(context,begin,end,isExclusive)debugLogFound(foundResource)ARGUMENT_NUMBER_MISMATCH
    rangeMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression range.init(context,begin,end,isExclusive) 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,isExclusive) 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
    14
    debugLogFound(foundResource);
    3
    return range;
    3
    return range;
    Preondition Violations
    Unmatched return range;
                                    
                                                      
    15
    return foundResource;
    Preondition Violations
    Unmatched return foundResource;
    15
    return foundResource;
    Precondition Violations (7)
    Row Violation
    1Unmatched statement LoadServiceResource foundResource=new LoadServiceResource(loc,loc.getPath()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression range.init(context,begin,end,isExclusive) is a void method call, and thus it cannot be parameterized
    3Expression debugLogFound(foundResource) is a void method call, and thus it cannot be parameterized
    4Expression range.init(context,begin,end,isExclusive) is a void method call, and thus it cannot be parameterized
    5Expression debugLogFound(foundResource) is a void method call, and thus it cannot be parameterized
    6Unmatched return range;
    7Unmatched return foundResource;