File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java | |||
Method name: void compileOpElementAsgnWithOr(Node, BodyCompiler, boolean)
|
Method name: void compileOpElementAsgnWithAnd(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | final OpElementAsgnNode opElementAsgnNode = (OpElementAsgnNode) node;↵ | 1 | final OpElementAsgnNode opElementAsgnNode = (OpElementAsgnNode) node;↵ | |
2 | CompilerCallback receiverCallback = new CompilerCallback() {↵ | 2 | CompilerCallback receiverCallback = new CompilerCallback() {↵ | |
3 | public void call(BodyCompiler context) {↵ | 3 | public void call(BodyCompiler context) {↵ | |
4 | compile(opElementAsgnNode.getReceiverNode(), context, true);↵ | 4 | compile(opElementAsgnNode.getReceiverNode(), context, true);↵ | |
5 | }↵ | 5 | }↵ | |
6 | };↵ | 6 | };↵ | |
7 | ArgumentsCallback argsCallback = new OpElementAsgnArgumentsCallback(opElementAsgnNode.getArgsNode());↵ | 7 | ArgumentsCallback argsCallback = new OpElementAsgnArgumentsCallback(opElementAsgnNode.getArgsNode()); ↵ | |
8 | CompilerCallback valueCallback = new CompilerCallback() {↵ | 8 | CompilerCallback valueCallback = new CompilerCallback() {↵ | |
9 | public void call(BodyCompiler context) {↵ | 9 | public void call(BodyCompiler context) {↵ | |
10 | compile(opElementAsgnNode.getValueNode(), context, true);↵ | 10 | compile(opElementAsgnNode.getValueNode(), context, true);↵ | |
11 | }↵ | 11 | }↵ | |
12 | };↵ | 12 | };↵ | |
13 | context.getInvocationCompiler().opElementAsgnWithOr(receiverCallback, argsCallback, valueCallback);↵ | 13 | context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback, argsCallback, valueCallback);↵ | |
14 | // TODO: don't require pop↵ | 14 | // TODO: don't require pop↵ | |
15 | if (!expr) context.consumeCurrentValue(); | 15 |
| |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 7 |
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) | 7.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final OpElementAsgnNode opElementAsgnNode = (OpElementAsgnNode)node; | 1 | final OpElementAsgnNode opElementAsgnNode = (OpElementAsgnNode)node; | |||||||||||||||
2 | CompilerCallback receiverCallback = new CompilerCallback() {...}; | 2 | CompilerCallback receiverCallback = new CompilerCallback() {...}; | |||||||||||||||
3 | ArgumentsCallback argsCallback = new OpElementAsgnArgumentsCallback(opElementAsgnNode.getArgsNode()); | 3 | ArgumentsCallback argsCallback = new OpElementAsgnArgumentsCallback(opElementAsgnNode.getArgsNode()); | |||||||||||||||
4 | CompilerCallback valueCallback = new CompilerCallback() {...}; | 4 | CompilerCallback valueCallback = new CompilerCallback() {...}; | |||||||||||||||
5 | context.getInvocationCompiler().opElementAsgnWithOr(receiverCallback, argsCallback, valueCallback); |
| 5 | context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback, argsCallback, valueCallback); | ||||||||||||||
6 | if (!expr) | 6 | if (!expr) | |||||||||||||||
7 | context.consumeCurrentValue(); | 7 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression context.getInvocationCompiler().opElementAsgnWithOr(receiverCallback,argsCallback,valueCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback,argsCallback,valueCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression context.getInvocationCompiler().opElementAsgnWithOr(receiverCallback,argsCallback,valueCallback) is a void method call, and thus it cannot be parameterized |
4 | Expression context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback,argsCallback,valueCallback) is a void method call, and thus it cannot be parameterized |