MethodInstaller invoker = (MethodInstaller) methodCallbacks.get(name); if (invoker == null) { invoker = new InstanceMethodInvokerInstaller(name); methodCallbacks.put(name, invoker); } invoker.addMethod(method, javaClass);
MethodInstaller invoker = (MethodInstaller) methodCallbacks.get(name); if (invoker == null) { invoker = new StaticMethodInvokerInstaller(name); methodCallbacks.put(name, invoker); } invoker.addMethod(method, javaClass);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java
Method name: void installInstanceMethods(Map, Class, Method, String) Method name: void installStaticMethods(Map, Class, Method, String)
Number of AST nodes: 5 Number of AST nodes: 5
1
MethodInstaller invoker = (MethodInstaller) methodCallbacks.get(name);
1
MethodInstaller invoker = (MethodInstaller) methodCallbacks.get(name);
2
        if (invoker == null) {
2
        if (invoker == null) {
3
            invoker = new InstanceMethodInvokerInstaller(name);
3
            invoker = new StaticMethodInvokerInstaller(name);
4
            methodCallbacks.put(name, invoker);
4
            methodCallbacks.put(name, invoker);
5
        }
5
        }
6
        invoker.addMethod(method, javaClass);
6
        invoker.addMethod(method, javaClass);
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 comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    MethodInstaller invoker = (MethodInstaller)methodCallbacks.get(name);
    1
    MethodInstaller invoker = (MethodInstaller)methodCallbacks.get(name);
    2
    if (invoker == null)
    2
    if (invoker == null)
    3
    invoker = new InstanceMethodInvokerInstaller(name);
    3
    invoker = new InstanceMethodInvokerInstaller(name);
    3
    invoker = new StaticMethodInvokerInstaller(name);
    Differences
    Expression1Expression2Difference
    org.jruby.javasupport.JavaClass.InstanceMethodInvokerInstallerorg.jruby.javasupport.JavaClass.StaticMethodInvokerInstallerSUBCLASS_TYPE_MISMATCH
    3
    invoker = new StaticMethodInvokerInstaller(name);
    4
    methodCallbacks.put(name, invoker);
    4
    methodCallbacks.put(name, invoker);
    5
    invoker.addMethod(method, javaClass);
    5
    invoker.addMethod(method, javaClass);
    5
    invoker.addMethod(method, javaClass);
    Differences
    Expression1Expression2Difference
    java.lang.Class<>java.lang.Class<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable javaClass does not match with type java.lang.Class<> of variable javaClass
    • Make classes java.lang.Class<> and java.lang.Class<> extend a common superclass
    5
    invoker.addMethod(method, javaClass);
    Precondition Violations (1)
    Row Violation
    1Type java.lang.Class<> of variable javaClass does not match with type java.lang.Class<> of variable javaClass