method.aload(ARGS_INDEX); method.arraylength(); method.ldc(jrubyMethod.required()); method.if_icmpne(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: 5 Number of AST nodes: 5
1
if (jrubyMethod.required() > 0) {
2
                    // confirm minimum args provided
1
method.aload(ARGS_INDEX);
3
                    method.aload(ARGS_INDEX);
2
                method.arraylength();
4
                    method.arraylength();
3
                method.ldc(jrubyMethod.required());
5
                    method.ldc(jrubyMethod.required());
4
                method.if_icmpne(arityError);
6
                    method.if_icmplt(arityError);
5
                checkArity = true;
7
                }
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.0
Clones locationClones are in the same method
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    29
    method.aload(ARGS_INDEX);
    20
    method.aload(ARGS_INDEX);
    30
    method.arraylength();
    21
    method.arraylength();
    31
    method.ldc(jrubyMethod.required());
    22
    method.ldc(jrubyMethod.required());
    32
    method.if_icmpne(arityError);
    32
    method.if_icmpne(arityError);
    23
    method.if_icmplt(arityError);
    Differences
    Expression1Expression2Difference
    if_icmpneif_icmpltMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression method.if_icmpne(arityError) is a void method call, and thus it cannot be parameterized
    Expression method.if_icmplt(arityError) is a void method call, and thus it cannot be parameterized
    23
    method.if_icmplt(arityError);
    33
    checkArity = true;
                                            
    Precondition Violations (2)
    Row Violation
    1Expression method.if_icmpne(arityError) is a void method call, and thus it cannot be parameterized
    2Expression method.if_icmplt(arityError) is a void method call, and thus it cannot be parameterized