RubyClass result = module.defineClassUnder("MemoryPointer", module.fastGetClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR); result.defineAnnotatedMethods(MemoryPointer.class); result.defineAnnotatedConstants(MemoryPointer.class); return result;
RubyClass cbClass = module.defineClassUnder("Callback", module.fastGetClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR); cbClass.defineAnnotatedMethods(Callback.class); cbClass.defineAnnotatedConstants(Callback.class); return cbClass;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/MemoryPointer.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/CallbackManager.java
Method name: RubyClass createMemoryPointerClass(Ruby, RubyModule) Method name: RubyClass createCallbackClass(Ruby, RubyModule)
Number of AST nodes: 4 Number of AST nodes: 4
1
RubyClass result = module.defineClassUnder("MemoryPointer",
1
RubyClass cbClass = module.defineClassUnder("
2
                module.fastGetClass("Pointer"),
2
Callback", module.fastGetClass("Pointer"),
3
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
3
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
4
        result.defineAnnotatedMethods(MemoryPointer.class);
4
        cbClass.defineAnnotatedMethods(Callback.class);
5
        result.defineAnnotatedConstants(MemoryPointer.class);
5
        cbClass.defineAnnotatedConstants(Callback.class);
6
        return result;
6
        return cbClass;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyClass result = module.defineClassUnder("MemoryPointer", module.fastGetClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
    1
    RubyClass result = module.defineClassUnder("MemoryPointer", module.fastGetClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
    1
    RubyClass cbClass = module.defineClassUnder("Callback", module.fastGetClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
    Differences
    Expression1Expression2Difference
    resultcbClassVARIABLE_NAME_MISMATCH
    "MemoryPointer""Callback"LITERAL_VALUE_MISMATCH
    1
    RubyClass cbClass = module.defineClassUnder("Callback", module.fastGetClass("Pointer"), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
    2
    result.defineAnnotatedMethods(MemoryPointer.class);
    2
    result.defineAnnotatedMethods(MemoryPointer.class);
    2
    cbClass.defineAnnotatedMethods(Callback.class);
    Differences
    Expression1Expression2Difference
    resultcbClassVARIABLE_NAME_MISMATCH
    2
    cbClass.defineAnnotatedMethods(Callback.class);
    3
    result.defineAnnotatedConstants(MemoryPointer.class);
    3
    result.defineAnnotatedConstants(MemoryPointer.class);
    3
    cbClass.defineAnnotatedConstants(Callback.class);
    Differences
    Expression1Expression2Difference
    resultcbClassVARIABLE_NAME_MISMATCH
    3
    cbClass.defineAnnotatedConstants(Callback.class);
    4
    return result;
    4
    return result;
    4
    return cbClass;
    Differences
    Expression1Expression2Difference
    resultcbClassVARIABLE_NAME_MISMATCH
    4
    return cbClass;
    Precondition Violations (0)
    Row Violation