if (jrubyMethod.required() > 0) { // just confirm minimum args provided method.aload(ARGS_INDEX); method.arraylength(); method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); checkArity = true; }
if (jrubyMethod.required() > 0) { // confirm minimum args provided method.aload(ARGS_INDEX); method.arraylength(); method.ldc(jrubyMethod.required()); method.if_icmplt(arityError); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/InvocationMethodFactory.java File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/InvocationMethodFactory.java
Method name: void checkArity(JRubyMethod, SkinnyMethodAdapter, int) Method name: void checkArity(JRubyMethod, SkinnyMethodAdapter, int)
Number of AST nodes: 6 Number of AST nodes: 5
1
if (jrubyMethod.required() > 0) {
1
if (jrubyMethod.required() > 0) {
2
                    // just confirm minimum args provided
2
                    // confirm minimum args provided
3
                    method.aload(ARGS_INDEX);
3
                    method.aload(ARGS_INDEX);
4
                    method.arraylength();
4
                    method.arraylength();
5
                    method.ldc(jrubyMethod.required());
5
                    method.ldc(jrubyMethod.required());
6
                    method.if_icmplt(arityError);
6
                    method.if_icmplt(arityError);
7
                    checkArity = true;
8
                }
7
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons31
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    12
    if (jrubyMethod.required() > 0)
    19
    if (jrubyMethod.required() > 0)
    13
    method.aload(ARGS_INDEX);
    20
    method.aload(ARGS_INDEX);
    14
    method.arraylength();
    21
    method.arraylength();
    15
    method.ldc(jrubyMethod.required());
    22
    method.ldc(jrubyMethod.required());
    16
    method.if_icmplt(arityError);
    23
    method.if_icmplt(arityError);
    17
    checkArity = true;
                                            
    Precondition Violations (0)
    Row Violation