try { Object result = handle != null ? handle.invoke(javaInvokee, arguments) : method.invoke(javaInvokee, arguments); return convertReturn(result); } catch (IllegalArgumentException iae) { return handlelIllegalArgumentEx(method, iae, arguments); } catch (IllegalAccessException iae) { return handleIllegalAccessEx(method, iae); } catch (InvocationTargetException ite) { return handleInvocationTargetEx(ite, method); } catch (Throwable t) { return handleThrowable(t, method); }
try { Object result = handle != null ? handle.invoke(javaInvokee, arg0) : method.invoke(javaInvokee, arg0); return convertReturn(result); } catch (IllegalArgumentException iae) { return handlelIllegalArgumentEx(method, iae, arg0); } catch (IllegalAccessException iae) { return handleIllegalAccessEx(method, iae); } catch (InvocationTargetException ite) { return handleInvocationTargetEx(ite, method); } catch (Throwable t) { return handleThrowable(t, method); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaMethod.java File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaMethod.java
Method name: IRubyObject invokeDirectWithExceptionHandling(Method, Object, Object[]) Method name: IRubyObject invokeDirectWithExceptionHandling(Method, Object, Object)
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try {
2
            Object result = handle != null
2
            Object result = handle != null
3
                    ? handle.invoke(javaInvokee, arguments)
3
                    ? handle.invoke(javaInvokee, arg0)
4
                    : method.invoke(javaInvokee, arguments);
4
                    : method.invoke(javaInvokee, arg0);
5
            return convertReturn(result);
5
            return convertReturn(result);
6
        } catch (IllegalArgumentException iae) {
6
        } catch (IllegalArgumentException iae) {
7
            return handlelIllegalArgumentEx(method, iae, arguments);
7
            return handlelIllegalArgumentEx(method, iae, arg0);
8
        } catch (IllegalAccessException iae) {
8
        } catch (IllegalAccessException iae) {
9
            return handleIllegalAccessEx(method, iae);
9
            return handleIllegalAccessEx(method, iae);
10
        } catch (InvocationTargetException ite) {
10
        } catch (InvocationTargetException ite) {
11
            return handleInvocationTargetEx(ite, method);
11
            return handleInvocationTargetEx(ite, method);
12
        } catch (Throwable t) {
12
        } catch (Throwable t) {
13
            return handleThrowable(t, method);
13
            return handleThrowable(t, method);
14
        }
14
        }
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.5
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    argumentsarg0VARIABLE_NAME_MISMATCH
    java.lang.Object[]java.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object[] of variable arguments does not match with type java.lang.Object of variable arg0
    • Make classes java.lang.Object[] and java.lang.Object extend a common superclass
    1
    try
    2
    Object result = handle != null ? handle.invoke(javaInvokee, arguments) : method.invoke(javaInvokee, arguments);
    2
    Object result = handle != null ? handle.invoke(javaInvokee, arguments) : method.invoke(javaInvokee, arguments);
    2
    Object result = handle != null ? handle.invoke(javaInvokee, arg0) : method.invoke(javaInvokee, arg0);
    Differences
    Expression1Expression2Difference
    argumentsarg0VARIABLE_NAME_MISMATCH
    java.lang.Object[]java.lang.ObjectVARIABLE_TYPE_MISMATCH
    argumentsarg0VARIABLE_NAME_MISMATCH
    java.lang.Object[]java.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object[] of variable arguments does not match with type java.lang.Object of variable arg0
    • Make classes java.lang.Object[] and java.lang.Object extend a common superclass
    Type java.lang.Object[] of variable arguments does not match with type java.lang.Object of variable arg0
    • Make classes java.lang.Object[] and java.lang.Object extend a common superclass
    2
    Object result = handle != null ? handle.invoke(javaInvokee, arg0) : method.invoke(javaInvokee, arg0);
    3
    return convertReturn(result);
    3
    return convertReturn(result);
    Precondition Violations (3)
    Row Violation
    1Type java.lang.Object[] of variable arguments does not match with type java.lang.Object of variable arg0
    2Type java.lang.Object[] of variable arguments does not match with type java.lang.Object of variable arg0
    3Type java.lang.Object[] of variable arguments does not match with type java.lang.Object of variable arg0