File path: /jruby-1.4.0/src/org/jruby/RubyHash.java | File path: /jruby-1.4.0/src/org/jruby/RubyArray.java | |||
Method name: RubyClass createHashClass(Ruby)
|
Method name: RubyClass createArrayClass(Ruby)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | RubyClass hashc = runtime.defineClass("Hash", runtime.getObject(), HASH_ALLOCATOR);↵ | 1 | RubyClass arrayc = runtime.defineClass("Array", runtime.getObject(), ARRAY_ALLOCATOR);↵ | |
2 | runtime.setHash(hashc);↵ | 2 | runtime.setArray(arrayc);↵ | |
3 | hashc.index = ClassIndex.HASH;↵ | 3 | arrayc.index = ClassIndex.ARRAY;↵ | |
4 | hashc.kindOf = new RubyModule.KindOf() {↵ | 4 | arrayc.kindOf = new RubyModule.KindOf() {↵ | |
5 | @Override↵ | 5 | @Override↵ | |
6 | public boolean isKindOf(IRubyObject obj, RubyModule type) {↵ | 6 | public boolean isKindOf(IRubyObject obj, RubyModule type) {↵ | |
7 | return obj instanceof RubyHash;↵ | 7 | return obj instanceof RubyArray;↵ | |
8 | }↵ | 8 | }↵ | |
9 | };↵ | 9 | };↵ | |
10 | hashc.includeModule(runtime.getEnumerable());↵ | 10 | arrayc.includeModule(runtime.getEnumerable());↵ | |
11 | hashc.defineAnnotatedMethods(RubyHash.class);↵ | 11 | arrayc.defineAnnotatedMethods(RubyArray.class);↵ | |
12 | return hashc; | 12 | return arrayc; | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 25 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyClass hashc = runtime.defineClass("Hash", runtime.getObject(), HASH_ALLOCATOR); |
| 1 | RubyClass arrayc = runtime.defineClass("Array", runtime.getObject(), ARRAY_ALLOCATOR); | |||||||||||||||||
2 | runtime.setHash(hashc); |
| 2 | runtime.setArray(arrayc); | |||||||||||||||||
3 | hashc.index = ClassIndex.HASH; |
| 3 | arrayc.index = ClassIndex.ARRAY; | |||||||||||||||||
4 | hashc.kindOf = new RubyModule.KindOf() {...}; |
| 4 | arrayc.kindOf = new RubyModule.KindOf() {...}; | |||||||||||||||||
5 | hashc.includeModule(runtime.getEnumerable()); |
| 5 | arrayc.includeModule(runtime.getEnumerable()); | |||||||||||||||||
6 | hashc.defineAnnotatedMethods(RubyHash.class); |
| 6 | arrayc.defineAnnotatedMethods(RubyArray.class); | |||||||||||||||||
7 | return hashc; |
| 7 | return arrayc; |
Row | Violation |
---|---|
1 | Expression runtime.setHash(hashc) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression runtime.setArray(arrayc) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression runtime.setHash(hashc) is a void method call, and thus it cannot be parameterized |
4 | Expression runtime.setArray(arrayc) is a void method call, and thus it cannot be parameterized |