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 compileOpElementAsgnWithAnd(Node, BodyCompiler, boolean)
|
Method name: void compileOpElementAsgnWithMethod(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 = getArgsCallback(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().opElementAsgnWithAnd(receiverCallback, argsCallback, valueCallback);↵ | 13 | context.getInvocationCompiler().opElementAsgnWithMethod(receiverCallback, argsCallback, valueCallback, opElementAsgnNode.getOperatorName());↵ | |
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 | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 7.8 |
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 = getArgsCallback(opElementAsgnNode.getArgsNode()); | ||||||||||||||||||||||
3 | ArgumentsCallback argsCallback = new OpElementAsgnArgumentsCallback(opElementAsgnNode.getArgsNode()); |
| | ||||||||||||||||||||||
4 | CompilerCallback valueCallback = new CompilerCallback() {...}; | 4 | CompilerCallback valueCallback = new CompilerCallback() {...}; | ||||||||||||||||||||||
5 | context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback, argsCallback, valueCallback); |
| 5 | context.getInvocationCompiler().opElementAsgnWithMethod(receiverCallback, argsCallback, valueCallback, opElementAsgnNode.getOperatorName()); | |||||||||||||||||||||
6 | if (!expr) | 6 | if (!expr) | ||||||||||||||||||||||
7 | context.consumeCurrentValue(); | 7 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Unmatched statement ArgumentsCallback argsCallback=getArgsCallback(opElementAsgnNode.getArgsNode()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement ArgumentsCallback argsCallback=new OpElementAsgnArgumentsCallback(opElementAsgnNode.getArgsNode()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback,argsCallback,valueCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression context.getInvocationCompiler().opElementAsgnWithMethod(receiverCallback,argsCallback,valueCallback,opElementAsgnNode.getOperatorName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback,argsCallback,valueCallback) is a void method call, and thus it cannot be parameterized |
6 | Expression context.getInvocationCompiler().opElementAsgnWithMethod(receiverCallback,argsCallback,valueCallback,opElementAsgnNode.getOperatorName()) is a void method call, and thus it cannot be parameterized |
7 | Expression context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback,argsCallback,valueCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression context.getInvocationCompiler().opElementAsgnWithMethod(receiverCallback,argsCallback,valueCallback,opElementAsgnNode.getOperatorName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression context.getInvocationCompiler().opElementAsgnWithAnd(receiverCallback,argsCallback,valueCallback) is a void method call, and thus it cannot be parameterized |
10 | Expression context.getInvocationCompiler().opElementAsgnWithMethod(receiverCallback,argsCallback,valueCallback,opElementAsgnNode.getOperatorName()) is a void method call, and thus it cannot be parameterized |