RubyClass result = module.defineClassUnder("VariadicInvoker", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR); result.defineAnnotatedMethods(VariadicInvoker.class); result.defineAnnotatedConstants(VariadicInvoker.class); return result;
RubyClass result = module.defineClassUnder(AUTOPTR_CLASS_NAME, module.getClass("Pointer"), AutoPointerAllocator.INSTANCE); result.defineAnnotatedMethods(AutoPointer.class); result.defineAnnotatedConstants(AutoPointer.class); return result;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/VariadicInvoker.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/AutoPointer.java
Method name: RubyClass createVariadicInvokerClass(Ruby, RubyModule) Method name: RubyClass createAutoPointerClass(Ruby, RubyModule)
Number of AST nodes: 4 Number of AST nodes: 4
1
RubyClass result = module.defineClassUnder("VariadicInvoker",
1
RubyClass result = module.defineClassUnder(
2
                runtime.getObject(
2
AUTOPTR_CLASS_NAME,
3
),
3
                module.getClass("Pointer"),
4
                ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
4
                AutoPointerAllocator.INSTANCE);
5
        result.defineAnnotatedMethods(VariadicInvoker.class);
5
        result.defineAnnotatedMethods(AutoPointer.class);
6
        result.defineAnnotatedConstants(VariadicInvoker.class);
6
        result.defineAnnotatedConstants(AutoPointer.class);
7
        return result;
7
        return result;
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 having the same super class
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                      
    1
    RubyClass result = module.defineClassUnder(AUTOPTR_CLASS_NAME, module.getClass("Pointer"), AutoPointerAllocator.INSTANCE);
    1
    RubyClass result = module.defineClassUnder("VariadicInvoker", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
                                                                                                                                                                                                                                                              
    2
    result.defineAnnotatedMethods(VariadicInvoker.class);
    2
    result.defineAnnotatedMethods(AutoPointer.class);
    3
    result.defineAnnotatedConstants(VariadicInvoker.class);
    3
    result.defineAnnotatedConstants(AutoPointer.class);
    4
    return result;
    4
    return result;
    Precondition Violations (0)
    Row Violation