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 compileOpAsgnAnd(Node, BodyCompiler, boolean)
|
Method name: void compileMatch2(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | final BinaryOperatorNode andNode = (BinaryOperatorNode) node;↵ | 1 | final Match2Node matchNode = (Match2Node) node;↵ | |
2 | compile(andNode.getFirstNode(), context,true);↵ | 2 | compile(matchNode.getReceiverNode(), context,true);↵ | |
3 | BranchCallback longCallback = new BranchCallback() {↵ | 3 | CompilerCallback value = new CompilerCallback() {↵ | |
4 | public void branch(BodyCompiler context) {↵ | 4 | public void call(BodyCompiler context) {↵ | |
5 | compile(andNode.getSecondNode(), context,true);↵ | 5 | compile(matchNode.getValueNode(), context,true);↵ | |
6 | }↵ | 6 | ↵ | |
7 | ↵ | 7 | }↵ | |
8 | };↵ | 8 | };↵ | |
9 | context.performLogicalAnd(longCallback);↵ | 9 | context.↵ | |
10 | context.pollThreadEvents();↵ | 10 | match2(value);↵ | |
11 | // TODO: don't require pop↵ | 11 | // TODO: don't require pop↵ | |
12 | if (!expr) context.consumeCurrentValue(); | 12 |
| |
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 | 24 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | final Match2Node matchNode = (Match2Node)node; | ||||||||||||||||||||||
1 | final BinaryOperatorNode andNode = (BinaryOperatorNode)node; | | ||||||||||||||||||||||
2 | compile(andNode.getFirstNode(), context, true); | | ||||||||||||||||||||||
3 | BranchCallback longCallback = new BranchCallback() {...}; | | ||||||||||||||||||||||
4 | context.performLogicalAnd(longCallback); |
| 2 | compile(matchNode.getReceiverNode(), context, true); | ||||||||||||||||||||
|
| 3 | CompilerCallback value = new CompilerCallback() {...}; | |||||||||||||||||||||
5 | context.pollThreadEvents(); |
| 4 | context.match2(value); | ||||||||||||||||||||
6 | if (!expr) | 5 | if (!expr) | |||||||||||||||||||||
7 | context.consumeCurrentValue(); | 6 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression context.performLogicalAnd(longCallback) is a void method call, and thus it cannot be parameterized |
2 | Expression compile(matchNode.getReceiverNode(),context,true) is a void method call, and thus it cannot be parameterized |
3 | Expression context.performLogicalAnd(longCallback) is a void method call, and thus it cannot be parameterized |
4 | Expression compile(matchNode.getReceiverNode(),context,true) is a void method call, and thus it cannot be parameterized |
5 | Unmatched statement CompilerCallback value=new CompilerCallback(){ public void call( BodyCompiler context){ compile(matchNode.getValueNode(),context,true); } } ; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Expression context.match2(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression context.pollThreadEvents() is a void method call, and thus it cannot be parameterized |
8 | Expression context.match2(value) is a void method call, and thus it cannot be parameterized |
9 | Expression context.match2(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression context.pollThreadEvents() is a void method call, and thus it cannot be parameterized |
11 | Expression context.match2(value) is a void method call, and thus it cannot be parameterized |