File path: /jruby-1.4.0/src/org/jruby/javasupport/proxy/JavaProxyReflectionObject.java | File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java | |||
Method name: RubyArray buildRubyArray(IRubyObject[])
|
Method name: RubyArray buildConstructors(Constructor>[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | RubyArray result = getRuntime().newArray(constructors.length);↵ | 1 | RubyArray result = getRuntime().newArray(constructors.length);↵ | |
2 | for (int i = 0; i < constructors.length; i++) {↵ | 2 | for (int i = 0; i < constructors.length; i++) {↵ | |
3 | result.append(constructors[i]);↵ | 3 | result.append(new JavaConstructor(getRuntime(), constructors[i]));↵ | |
4 | }↵ | 4 | }↵ | |
5 | return result; | 5 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 8 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyArray result = getRuntime().newArray(constructors.length); |
| 1 | RubyArray result = getRuntime().newArray(constructors.length); | |||||||||||
2 | for (int i = 0; i < constructors.length; i++) |
| 2 | for (int i = 0; i < constructors.length; i++) | |||||||||||
|
| 3 | result.append(new JavaConstructor(getRuntime(), constructors[i])); | ||||||||||||
3 | result.append(constructors[i]); |
| | ||||||||||||
4 | return result; | 4 | return result; |
Row | Violation |
---|---|
1 | Type org.jruby.runtime.builtin.IRubyObject[] of variable constructors does not match with type java.lang.reflect.Constructor<?>[] of variable constructors |
2 | Type org.jruby.runtime.builtin.IRubyObject[] of variable constructors does not match with type java.lang.reflect.Constructor<?>[] of variable constructors |
3 | Unmatched statement result.append(new JavaConstructor(getRuntime(),constructors[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement result.append(constructors[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables result, i , while Clone fragment #2 returns variables result, i |