RubyClass result = runtime.defineClassUnder(CLASS_NAME, runtime.fastGetClass("IO"),
Allocator.INSTANCE, module);
result.defineAnnotatedMethods(FileDescriptorIO.class);
result.defineAnnotatedConstants(FileDescriptorIO.class);
return result;
RubyClass result = module.defineClassUnder(ABSTRACT_MEMORY_RUBY_CLASS,
runtime.getObject(),
ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);
result.defineAnnotatedMethods(AbstractMemory.class);
result.defineAnnotatedConstants(AbstractMemory.class);
return result;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/io/FileDescriptorIO.java
|
|
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/AbstractMemory.java
|
Method name: RubyClass createFileDescriptorIOClass(Ruby, RubyModule)
|
|
Method name: RubyClass createAbstractMemoryClass(Ruby, RubyModule)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | RubyClass result = runtime.defineClassUnder(CLASS_NAME, runtime.fastGetClass("IO"↵ | | 1 | RubyClass result = module.defineClassUnder(ABSTRACT_MEMORY_RUBY_CLASS,↵
|
2 | ),↵ | | 2 | runtime.getObject(),↵
|
3 | Allocator.INSTANCE, module);↵ | | 3 | ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);↵
|
| | | 4 | ↵
|
4 | result.defineAnnotatedMethods(FileDescriptorIO.class);↵ | | 5 | result.defineAnnotatedMethods(AbstractMemory.class);↵
|
5 | result.defineAnnotatedConstants(FileDescriptorIO.class);↵ | | 6 | result.defineAnnotatedConstants(AbstractMemory.class);↵
|
|
6 | 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(ABSTRACT_MEMORY_RUBY_CLASS, runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR); |
1 | RubyClass result = runtime.defineClassUnder(CLASS_NAME, runtime.fastGetClass("IO"), Allocator.INSTANCE, module); | | | |
2 | result.defineAnnotatedMethods(FileDescriptorIO.class); | | 2 | result.defineAnnotatedMethods(AbstractMemory.class); |
3 | result.defineAnnotatedConstants(FileDescriptorIO.class); | | 3 | result.defineAnnotatedConstants(AbstractMemory.class); |
4 | return result; | | 4 | return result; |
Precondition Violations (0)
Row |
Violation |