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;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 12 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 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 |