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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 31 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.6 |
Clone type | Type 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 | | | 21 | |
15 | method.ldc(jrubyMethod.required()); | | 22 | method.ldc(jrubyMethod.required()); |
16 | method.if_icmplt(arityError); | | 23 | method.if_icmplt(arityError); |
17 | | | | |
Precondition Violations (0)
Row |
Violation |