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 compileBackref(Node, BodyCompiler, boolean)
|
Method name: void compileClassVar(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | BackRefNode iVisited = (BackRefNode) node;↵ | |||
2 | context.performBackref(iVisited↵ | 1 | ClassVarNode classVarNode = (ClassVarNode) node;↵ | |
3 | .getType());↵ | 2 | context.retrieveClassVariable(classVarNode.getName());↵ | |
4 | // TODO: don't require pop↵ | |||
5 | if (!expr) context.consumeCurrentValue(); | 3 |
| |
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 | 8 |
Number of mapped statements | 3 |
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) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | BackRefNode iVisited = (BackRefNode)node; |
| 1 | ClassVarNode classVarNode = (ClassVarNode)node; | |||||||||||||||||||
| 2 | context.retrieveClassVariable(classVarNode.getName()); | |||||||||||||||||||||
2 | context.performBackref(iVisited.getType()); | | |||||||||||||||||||||
3 | if (!expr) | 3 | if (!expr) | ||||||||||||||||||||
4 | context.consumeCurrentValue(); | 4 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variable iVisited with type org.jruby.ast.BackRefNode , while Clone fragment #2 returns variable classVarNode with type org.jruby.ast.ClassVarNode |