JavaConverter converter = JAVA_CONVERTERS.get(clazz); if (converter == null) { converter = JAVA_DEFAULT_CONVERTER; } 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: JavaConverter getJavaConverter(Class) Method name: RubyConverter getArrayConverter(Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
JavaConverter converter = JAVA_CONVERTERS.get(clazz);
1
RubyConverter converter = ARRAY_CONVERTERS.get(type);
2
        if (converter == null) {
2
        if (converter == null) {
3
            converter = JAVA_DEFAULT_CONVERTER;
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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                
    1
    RubyConverter converter = ARRAY_CONVERTERS.get(type);
    1
    JavaConverter converter = JAVA_CONVERTERS.get(clazz);
                                                                                                                
    2
    if (converter == null)
    2
    if (converter == null)
    2
    if (converter == null)
    Differences
    Expression1Expression2Difference
    org.jruby.javasupport.JavaUtil.JavaConverterorg.jruby.javasupport.JavaUtil.RubyConverterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.javasupport.JavaUtil.JavaConverter of variable converter does not match with type org.jruby.javasupport.JavaUtil.RubyConverter of variable converter
    • Make classes org.jruby.javasupport.JavaUtil.JavaConverter 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
    converter = JAVA_DEFAULT_CONVERTER;
    3
    converter = JAVA_DEFAULT_CONVERTER;
    Preondition Violations
    Unmatched statement converter=JAVA_DEFAULT_CONVERTER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
                                            
    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.JavaConverter of variable converter does not match with type org.jruby.javasupport.JavaUtil.RubyConverter of variable converter
    2Unmatched return ARRAY_OBJECT_CONVERTER;
    3Unmatched statement converter=JAVA_DEFAULT_CONVERTER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return converter;
    5Unmatched return converter;