NumericConverter converter = NUMERIC_CONVERTERS.get(target); if (converter == null) { return NUMERIC_TO_OTHER; } return converter;
RubyConverter converter = ARRAY_CONVERTERS.get(type); if (converter == null) { return ARRAY_OBJECT_CONVERTER; } return converter;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaUtil.java File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaUtil.java
Method name: NumericConverter getNumericConverter(Class) Method name: RubyConverter getArrayConverter(Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
NumericConverter converter = NUMERIC_CONVERTERS.get(target);
1
RubyConverter converter = ARRAY_CONVERTERS.get(type);
2
        if (converter == null) {
2
        if (converter == null) {
3
            return NUMERIC_TO_OTHER;
3
            return ARRAY_OBJECT_CONVERTER;
4
        }
4
        }
5
        return converter;
5
        return converter;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                
    1
    RubyConverter converter = ARRAY_CONVERTERS.get(type);
    1
    NumericConverter converter = NUMERIC_CONVERTERS.get(target);
                                                                                                                              
    2
    if (converter == null)
    2
    if (converter == null)
    2
    if (converter == null)
    Differences
    Expression1Expression2Difference
    org.jruby.javasupport.JavaUtil.NumericConverterorg.jruby.javasupport.JavaUtil.RubyConverterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.javasupport.JavaUtil.NumericConverter of variable converter does not match with type org.jruby.javasupport.JavaUtil.RubyConverter of variable converter
    • Make classes org.jruby.javasupport.JavaUtil.NumericConverter and org.jruby.javasupport.JavaUtil.RubyConverter extend a common superclass
    2
    if (converter == null)
                                                                      
    3
    return ARRAY_OBJECT_CONVERTER;
    Preondition Violations
    Unmatched return ARRAY_OBJECT_CONVERTER;
    3
    return ARRAY_OBJECT_CONVERTER;
    3
    return NUMERIC_TO_OTHER;
    3
    return NUMERIC_TO_OTHER;
    Preondition Violations
    Unmatched return NUMERIC_TO_OTHER;
                                                          
                                            
    4
    return converter;
    Preondition Violations
    Unmatched return converter;
    4
    return converter;
    4
    return converter;
    4
    return converter;
    Preondition Violations
    Unmatched return converter;
                                            
    Precondition Violations (5)
    Row Violation
    1Type org.jruby.javasupport.JavaUtil.NumericConverter of variable converter does not match with type org.jruby.javasupport.JavaUtil.RubyConverter of variable converter
    2Unmatched return ARRAY_OBJECT_CONVERTER;
    3Unmatched return NUMERIC_TO_OTHER;
    4Unmatched return converter;
    5Unmatched return converter;