RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileStat()); stat.setup(filename, lstat); return stat;
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/RubyFileStat.java File path: /jruby-1.4.0/src/org/jruby/runtime/load/LoadService.java
Method name: RubyFileStat newFileStat(Ruby, String, boolean) Method name: LoadServiceResource findFileInClasspath(String)
Number of AST nodes: 3 Number of AST nodes: 4
1
RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileSt
1
if (isRequireable(loc)) {
2
at());
2
                LoadServiceResource foundResource = new LoadServiceResource(loc, loc.getPath());
3
        
3
        
4
        stat.setup(filename, lstat);
4
        debugLogFound(foundResource);
5
        
5
        
6
        return stat;
6
        return foundResource;
7
            }
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
    RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileStat());
                                                                                                                                              
                                                                                                                                                                      
    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
    stat.setup(filename, lstat);
    2
    stat.setup(filename, lstat);
    14
    debugLogFound(foundResource);
    Differences
    Expression1Expression2Difference
    setupdebugLogFoundMETHOD_INVOCATION_NAME_MISMATCH
    stat.setup(filename,lstat)debugLogFound(foundResource)ARGUMENT_NUMBER_MISMATCH
    statMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression stat.setup(filename,lstat) 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 stat.setup(filename,lstat) 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 stat;
    3
    return stat;
    Preondition Violations
    Unmatched return stat;
                                  
                                                      
    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 stat.setup(filename,lstat) 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 stat.setup(filename,lstat) 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 stat;
    7Unmatched return foundResource;