int signatureCode = argsHashCode(args); ParameterTypes method = (ParameterTypes)cache.get(signatureCode); if (method == null) { method = findMatchingCallableForArgs(recv, cache, signatureCode, methods, args); } return method;
int signatureCode = argsHashCode(args); JavaCallable method = (JavaCallable)cache.get(signatureCode); if (method == null) { method = (JavaCallable)findMatchingCallableForArgs(recv, cache, signatureCode, methods, args); } return method;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/java/dispatch/CallableSelector.java File path: /jruby-1.4.0/src/org/jruby/java/dispatch/CallableSelector.java
Method name: ParameterTypes matchingCallableArityN(IRubyObject, Map, ParameterTypes[], IRubyObject[], int) Method name: JavaCallable matchingCallableArityN(IRubyObject, Map, JavaCallable[], IRubyObject[], int)
Number of AST nodes: 5 Number of AST nodes: 5
1
int signatureCode = argsHashCode(args);
1
int signatureCode = argsHashCode(args);
2
        ParameterTypes method = (ParameterTypes)cache.get(signatureCode);
2
        JavaCallable method = (JavaCallable)cache.get(signatureCode);
3
        if (method == null) {
3
        if (method == null) {
4
            method = findMatchingCallableForArgs(recv, cache, signatureCode, methods, args);
4
            method = (JavaCallable)findMatchingCallableForArgs(recv, cache, signatureCode, methods, args);
5
        }
5
        }
6
        return method;
6
        return method;
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 statements2
    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
    int signatureCode = argsHashCode(args);
    1
    int signatureCode = argsHashCode(args);
                                                                                                                                
    2
    JavaCallable method = (JavaCallable)cache.get(signatureCode);
    Preondition Violations
    Unmatched statement JavaCallable method=(JavaCallable)cache.get(signatureCode); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    JavaCallable method = (JavaCallable)cache.get(signatureCode);
    2
    ParameterTypes method = (ParameterTypes)cache.get(signatureCode);
    2
    ParameterTypes method = (ParameterTypes)cache.get(signatureCode);
    Preondition Violations
    Unmatched statement ParameterTypes method=(ParameterTypes)cache.get(signatureCode); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                        
    3
    if (method == null)
    3
    if (method == null)
    3
    if (method == null)
    Differences
    Expression1Expression2Difference
    org.jruby.javasupport.ParameterTypesorg.jruby.javasupport.JavaCallableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.javasupport.ParameterTypes of variable method does not match with type org.jruby.javasupport.JavaCallable of variable method
    • Make classes org.jruby.javasupport.ParameterTypes and org.jruby.javasupport.JavaCallable extend a common superclass
    3
    if (method == null)
                                                                                                                                                                                          
    4
    method = (JavaCallable)findMatchingCallableForArgs(recv, cache, signatureCode, methods, args);
    Preondition Violations
    Unmatched statement method=(JavaCallable)findMatchingCallableForArgs(recv,cache,signatureCode,methods,args); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    method = (JavaCallable)findMatchingCallableForArgs(recv, cache, signatureCode, methods, args);
    4
    method = findMatchingCallableForArgs(recv, cache, signatureCode, methods, args);
    4
    method = findMatchingCallableForArgs(recv, cache, signatureCode, methods, args);
    Preondition Violations
    Unmatched statement method=findMatchingCallableForArgs(recv,cache,signatureCode,methods,args); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                              
                                      
    5
    return method;
    Preondition Violations
    Unmatched return method;
    5
    return method;
    5
    return method;
    5
    return method;
    Preondition Violations
    Unmatched return method;
                                      
    Precondition Violations (7)
    Row Violation
    1Unmatched statement JavaCallable method=(JavaCallable)cache.get(signatureCode); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ParameterTypes method=(ParameterTypes)cache.get(signatureCode); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.jruby.javasupport.ParameterTypes of variable method does not match with type org.jruby.javasupport.JavaCallable of variable method
    4Unmatched statement method=(JavaCallable)findMatchingCallableForArgs(recv,cache,signatureCode,methods,args); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement method=findMatchingCallableForArgs(recv,cache,signatureCode,methods,args); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return method;
    7Unmatched return method;