BlockBody body = blockBodies[index]; if (body == null) { return createBlockBody19(scriptObject, context, index, descriptor); } return body;
CompiledBlockCallback callback = blockCallbacks[index]; if (callback == null) { return createCompiledBlockCallback(scriptObject, runtime, index, method); } return callback;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ast/executable/AbstractScript.java File path: /jruby-1.4.0/src/org/jruby/ast/executable/AbstractScript.java
Method name: BlockBody getBlockBody19(Object, ThreadContext, int, String) Method name: CompiledBlockCallback getBlockCallback(Object, Ruby, int, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
BlockBody body = blockBodies[index];
1
CompiledBlockCallback callback = blockCallbacks[index];
2
            if (body == null) {
2
            if (callback == null) {
3
                return createBlockBody19(scriptObject, context, index, descriptor);
3
                return createCompiledBlockCallback(scriptObject, runtime, index, method);
4
            }
4
            }
5
            return body;
5
            return callback;
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 statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                    
    1
    CompiledBlockCallback callback = blockCallbacks[index];
    1
    BlockBody body = blockBodies[index];
                                                                              
    2
    if (body == null)
    2
    if (body == null)
    2
    if (callback == null)
    Differences
    Expression1Expression2Difference
    bodycallbackVARIABLE_NAME_MISMATCH
    org.jruby.runtime.BlockBodyorg.jruby.runtime.CompiledBlockCallbackVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.runtime.BlockBody of variable body does not match with type org.jruby.runtime.CompiledBlockCallback of variable callback
    • Make classes org.jruby.runtime.BlockBody and org.jruby.runtime.CompiledBlockCallback extend a common superclass
    2
    if (callback == null)
                                                                                                                                                      
    3
    return createCompiledBlockCallback(scriptObject, runtime, index, method);
    Preondition Violations
    Unmatched return createCompiledBlockCallback(scriptObject,runtime,index,method);
    3
    return createCompiledBlockCallback(scriptObject, runtime, index, method);
    3
    return createBlockBody19(scriptObject, context, index, descriptor);
    3
    return createBlockBody19(scriptObject, context, index, descriptor);
    Preondition Violations
    Unmatched return createBlockBody19(scriptObject,context,index,descriptor);
                                                                                                                                          
                                          
    4
    return callback;
    Preondition Violations
    Unmatched return callback;
    4
    return callback;
    4
    return body;
    4
    return body;
    Preondition Violations
    Unmatched return body;
                                  
    Precondition Violations (5)
    Row Violation
    1Type org.jruby.runtime.BlockBody of variable body does not match with type org.jruby.runtime.CompiledBlockCallback of variable callback
    2Unmatched return createCompiledBlockCallback(scriptObject,runtime,index,method);
    3Unmatched return createBlockBody19(scriptObject,context,index,descriptor);
    4Unmatched return callback;
    5Unmatched return body;