try { return (IRubyObject)blockMethod.invoke(scriptObject, new Object[]{context, self, args}); } catch (IllegalAccessException ex) { throw new RuntimeException(ex); } catch (IllegalArgumentException ex) { throw new RuntimeException(ex); } catch (InvocationTargetException ex) { Throwable cause = ex.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new RuntimeException(ex); } }
try { return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block); } catch (IllegalAccessException ex) { throw new RuntimeException(ex); } catch (IllegalArgumentException ex) { throw new RuntimeException(ex); } catch (InvocationTargetException ex) { Throwable cause = ex.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new RuntimeException(ex); } }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/callback/ReflectionCallbackFactory.java File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/ReflectionMethodFactory.java
Method name: IRubyObject call(ThreadContext, IRubyObject, IRubyObject) Method name: IRubyObject call(ThreadContext, IRubyObject, IRubyObject[], Block)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
                        return (IRubyObject)blockMethod.invoke(scriptObject, new Object[]{context, self, args});
2
                        return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block);
3
                    } catch (IllegalAccessException ex) {
3
                    } catch (IllegalAccessException ex) {
4
                        throw new RuntimeException(ex);
4
                        throw new RuntimeException(ex);
5
                    } catch (IllegalArgumentException ex) {
5
                    } catch (IllegalArgumentException ex) {
6
                        throw new RuntimeException(ex);
6
                        throw new RuntimeException(ex);
7
                    } catch (InvocationTargetException ex) {
7
                    } catch (InvocationTargetException ex) {
8
                        Throwable cause = ex.getCause();
8
                        Throwable cause = ex.getCause();
9
                        if (cause instanceof RuntimeException) {
9
                        if (cause instanceof RuntimeException) {
10
                            throw (RuntimeException) cause;
10
                            throw (RuntimeException) cause;
11
                        } else if (cause instanceof Error) {
11
                        } else if (cause instanceof Error) {
12
                            throw (Error) cause;
12
                            throw (Error) cause;
13
                        } else {
13
                        } else {
14
                            throw new RuntimeException(ex);
14
                            throw new RuntimeException(ex);
15
                        }
15
                        }
16
                    }
16
                    }
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)2.3
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    blockMethod.invoke(scriptObject,new Object[]{context,self,args})blockMethod.invoke(null,scriptObject,context,self,args,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression blockMethod.invoke(scriptObject,new Object[]{context,self,args}) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression blockMethod.invoke(null,scriptObject,context,self,args,block) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    1
    try
    2
    return (IRubyObject)blockMethod.invoke(scriptObject, new Object[] {context, self, args});
    2
    return (IRubyObject)blockMethod.invoke(scriptObject, new Object[] {context, self, args});
    2
    return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block);
    Differences
    Expression1Expression2Difference
    blockMethod.invoke(scriptObject,new Object[]{context,self,args})blockMethod.invoke(null,scriptObject,context,self,args,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression blockMethod.invoke(scriptObject,new Object[]{context,self,args}) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression blockMethod.invoke(null,scriptObject,context,self,args,block) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2
    return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block);
    Precondition Violations (4)
    Row Violation
    1Expression blockMethod.invoke(scriptObject,new Object[]{context,self,args}) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression blockMethod.invoke(null,scriptObject,context,self,args,block) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression blockMethod.invoke(scriptObject,new Object[]{context,self,args}) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression blockMethod.invoke(null,scriptObject,context,self,args,block) is a method call throwing exception(s) that should be caught by a try block that will be extracted