File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaUtil.java | File path: /jruby-1.4.0/src/org/jruby/java/MiniJava.java | |||
Method name: NumericConverter getNumericConverter(Class)
|
Method name: JavaMethodFactory getMethodFactory(Class)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | NumericConverter converter = NUMERIC_CONVERTERS.get(target);↵ | 1 | JavaMethodFactory factory = methodFactories.get(returnType);↵ | |
2 | if (converter == null) {↵ | 2 | if (factory == null) {↵ | |
3 | return NUMERIC_TO_OTHER;↵ | 3 | return JAVA_OBJECT_METHOD_FACTORY;↵ | |
4 | }↵ | 4 | }↵ | |
5 | return converter; | 5 | return factory; | |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | JavaMethodFactory factory = methodFactories.get(returnType); | ||||||||||||||||
1 | NumericConverter converter = NUMERIC_CONVERTERS.get(target); | | ||||||||||||||||
2 | if (converter == null) |
| 2 | if (factory == null) | ||||||||||||||
|
| 3 | return JAVA_OBJECT_METHOD_FACTORY; | |||||||||||||||
3 | return NUMERIC_TO_OTHER; |
| | |||||||||||||||
|
| 4 | return factory; | |||||||||||||||
4 | return converter; |
| |
Row | Violation |
---|---|
1 | Type org.jruby.javasupport.JavaUtil.NumericConverter of variable converter does not match with type org.jruby.java.MiniJava.JavaMethodFactory of variable factory |
2 | Unmatched return JAVA_OBJECT_METHOD_FACTORY; |
3 | Unmatched return NUMERIC_TO_OTHER; |
4 | Unmatched return factory; |
5 | Unmatched return converter; |