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 compileNext(Node, BodyCompiler, boolean)
|
Method name: void compileBreak(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | final NextNode nextNode = (NextNode) node;↵ | 1 | final BreakNode breakNode = (BreakNode) node;↵ | |
2 | CompilerCallback valueCallback = new CompilerCallback() {↵ | 2 | CompilerCallback valueCallback = new CompilerCallback() {↵ | |
3 | public void call(BodyCompiler context) {↵ | 3 | public void call(BodyCompiler context) {↵ | |
4 | if (nextNode.getValueNode() != null) {↵ | 4 | if (breakNode.getValueNode() != null) {↵ | |
5 | compile(nextNode.getValueNode(), context,true);↵ | 5 | compile(breakNode.getValueNode(), context, true);↵ | |
6 | } else {↵ | 6 | } else {↵ | |
7 | context.loadNil();↵ | 7 | context.loadNil();↵ | |
8 | }↵ | 8 | }↵ | |
9 | }↵ | 9 | }↵ | |
10 | };↵ | 10 | };↵ | |
11 | context.pollThreadEvents();↵ | 11 | context.↵ | |
12 | context.issueNextEvent(valueCallback);↵ | 12 | issueBreakEvent(valueCallback);↵ | |
13 | // TODO: don't require pop↵ | 13 | // TODO: don't require pop↵ | |
14 | if (!expr) context.consumeCurrentValue(); | 14 |
| |
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 | 11 |
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) | 12.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final NextNode nextNode = (NextNode)node; |
| 1 | final BreakNode breakNode = (BreakNode)node; | |||||||||||||||||||||
2 | CompilerCallback valueCallback = new CompilerCallback() {...}; |
| 2 | CompilerCallback valueCallback = new CompilerCallback() {...}; | |||||||||||||||||||||
3 | context.pollThreadEvents(); | | |||||||||||||||||||||||
4 | context.issueNextEvent(valueCallback); |
| 3 | context.issueBreakEvent(valueCallback); | |||||||||||||||||||||
5 | if (!expr) | 4 | if (!expr) | ||||||||||||||||||||||
6 | context.consumeCurrentValue(); | 5 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression nextNode cannot be unified with expression breakNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getValueNode() |
2 | Expression nextNode cannot be unified with expression breakNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getValueNode() |
3 | Expression context.issueNextEvent(valueCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression context.issueBreakEvent(valueCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression context.issueNextEvent(valueCallback) is a void method call, and thus it cannot be parameterized |
6 | Expression context.issueBreakEvent(valueCallback) is a void method call, and thus it cannot be parameterized |