NumericConverter converter = NUMERIC_CONVERTERS.get(target); if (converter == null) { return NUMERIC_TO_OTHER; } return converter;
JavaConverter converter = JAVA_CONVERTERS.get(clazz); if (converter == null) { converter = JAVA_DEFAULT_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: JavaConverter getJavaConverter(Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
NumericConverter converter = NUMERIC_CONVERTERS.get(target);
1
JavaConverter converter = JAVA_CONVERTERS.get(clazz);
2
        if (converter == null) {
2
        if (converter == null) {
3
            return NUMERIC_TO_OTHER;
3
            converter = JAVA_DEFAULT_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.1
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
    JavaConverter converter = JAVA_CONVERTERS.get(clazz);
    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.JavaConverterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.javasupport.JavaUtil.NumericConverter of variable converter does not match with type org.jruby.javasupport.JavaUtil.JavaConverter of variable converter
    • Make classes org.jruby.javasupport.JavaUtil.NumericConverter and org.jruby.javasupport.JavaUtil.JavaConverter extend a common superclass
    2
    if (converter == null)
                                                                            
    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
    3
    converter = JAVA_DEFAULT_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.JavaConverter of variable converter
    2Unmatched 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
    3Unmatched return NUMERIC_TO_OTHER;
    4Unmatched return converter;
    5Unmatched return converter;