File path: /jruby-1.4.0/src/org/jruby/ast/WhenNode.java | File path: /jruby-1.4.0/src/org/jruby/ast/YieldNode.java | |||
Method name: void WhenNode(ISourcePosition, Node, Node, Node)
|
Method name: void YieldNode(ISourcePosition, Node, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 5 | |||
1 | super(position);↵ | 1 | super(position);↵ | |
2 | this.expressionNodes = expressionNodes;↵ | 2 | ↵ | |
3 | if (expression↵ | |||
3 | // block.yield depends on null to represent empty and nil to represent nil - [nil] vs []↵ | |||
4 | //assert argsNode != null : "argsNode is not null";↵ | |||
5 | ↵ | |||
6 | this.argsNode = argsNode;↵ | |||
7 | // If we have more than one argument, then make sure the array is not ObjectSpaced.↵ | |||
4 | Nodes instanceof ArrayNode) {↵ | 8 | if (argsNode instanceof ArrayNode) {↵ | |
5 | ((ArrayNode)expressionNodes).setLightweight(true);↵ | 9 | ((ArrayNode)argsNode).setLightweight(true);↵ | |
6 | }↵ | 10 | }↵ | |
7 | assert bodyNode != null : "bodyNode is not null";↵ | 11 | ↵ | |
8 | ↵ | |||
9 | this.bodyNode = bodyNode;↵ | |||
10 | this.nextCase = nextCase; | 12 | this.expandedArguments = expandedArguments; | |
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 in different classes having the same super class |
Number of node comparisons | 14 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | super(position); | 1 | super(position); | ||||||||||||||||
2 | this.expressionNodes = expressionNodes; |
| 2 | this.argsNode = argsNode; | |||||||||||||||
3 | if (expressionNodes instanceof ArrayNode) |
| 3 | if (argsNode instanceof ArrayNode) | |||||||||||||||
4 | ((ArrayNode)expressionNodes).setLightweight(true); |
| 4 | ((ArrayNode)argsNode).setLightweight(true); | |||||||||||||||
| 5 | this.expandedArguments = expandedArguments; | |||||||||||||||||
5 | assert bodyNode != null : "bodyNode is not null"; | | |||||||||||||||||
6 | this.bodyNode = bodyNode; | | |||||||||||||||||
7 | this.nextCase = nextCase; | |
Row | Violation |
---|---|
1 | Expression this.expressionNodes is a field being modified, and thus it cannot be parameterized |
2 | Expression this.argsNode is a field being modified, and thus it cannot be parameterized |