File path: /jruby-1.4.0/src/org/jruby/compiler/impl/AbstractVariableCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/impl/AbstractVariableCompiler.java | |||
Method name: void assignMethodArguments19(Object, int, Object, int, int, Object, int, ArrayCallback, ArrayCallback, ArrayCallback, CompilerCallback, CompilerCallback)
|
Method name: void assignMethodArguments19(Object, int, Object, int, int, Object, int, ArrayCallback, ArrayCallback, ArrayCallback, CompilerCallback, CompilerCallback)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for (; currentArgElement < preArgsCount; currentArgElement++) {↵ | 1 | for (; currentArgElement < postArgsCount; currentArgElement++) {↵ | |
2 | // extract item from array↵ | 2 | // extract item from array↵ | |
3 | method.aload(argsIndex);↵ | 3 | method.aload(argsIndex);↵ | |
4 | method.pushInt(currentArgElement); // index for the item↵ | 4 | method.pushInt(currentArgElement); // index for the item↵ | |
5 | // this could probably be more efficient, bailing out on assigning args past the end?↵ | 5 | // this could probably be more efficient, bailing out on assigning args past the end?↵ | |
6 | methodCompiler.loadNil();↵ | 6 | methodCompiler.loadNil();↵ | |
7 | methodCompiler.invokeUtilityMethod("elementOrNil", sig(IRubyObject.class, IRubyObject[].class, int.class, IRubyObject.class));↵ | 7 | methodCompiler.invokeUtilityMethod("elementOrNil", sig(IRubyObject.class, IRubyObject[].class, int.class, IRubyObject.class));↵ | |
8 | requiredAssignment.nextValue(methodCompiler, preArgs, currentArgElement);↵ | 8 | requiredAssignment.nextValue(methodCompiler, postArgs, currentArgElement);↵ | |
9 | } | 9 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 37 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | for (; currentArgElement < preArgsCount; currentArgElement++) |
| 39 | for (; currentArgElement < postArgsCount; currentArgElement++) | ||||||||||
9 | method.aload(argsIndex); | 40 | method.aload(argsIndex); | |||||||||||
10 | method.pushInt(currentArgElement); | 41 | method.pushInt(currentArgElement); | |||||||||||
11 | methodCompiler.loadNil(); | 42 | methodCompiler.loadNil(); | |||||||||||
12 | methodCompiler.invokeUtilityMethod("elementOrNil", sig(IRubyObject.class, IRubyObject[].class, int.class, IRubyObject.class)); | 43 | methodCompiler.invokeUtilityMethod("elementOrNil", sig(IRubyObject.class, IRubyObject[].class, int.class, IRubyObject.class)); | |||||||||||
13 | requiredAssignment.nextValue(methodCompiler, preArgs, currentArgElement); |
| 44 | requiredAssignment.nextValue(methodCompiler, postArgs, currentArgElement); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables currentArgElement , while Clone fragment #2 returns variables |