File path: /jruby-1.4.0/src/org/jruby/Ruby.java | File path: /jruby-1.4.0/src/org/jruby/Ruby.java | |||
Method name: void loadConstantSet(RubyModule, Class
|
Method name: void initErrno()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for (E e : EnumSet.allOf(enumClass)) {↵ | 1 | for (Errno e : Errno.values()) {↵ | |
2 | Constant c = (Constant) e;↵ | 2 | Constant c = (Constant) e;↵ | |
3 | if (Character.isUpperCase(c.name().charAt(0))) {↵ | 3 | if (Character.isUpperCase(c.name().charAt(0))) {↵ | |
4 | module.fastSetConstant(c.name(), newFixnum(c.value()));↵ | 4 | createSysErr(c.value(), c.name());↵ | |
5 | }↵ | 5 | ↵ | |
6 | }↵ | |||
6 | } | 7 | } | |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | Constant c = (Constant)e; |
| 5 | Constant c = (Constant)e; | |||||||||||
3 | if (Character.isUpperCase(c.name().charAt(0))) | 6 | if (Character.isUpperCase(c.name().charAt(0))) | ||||||||||||
4 | module.fastSetConstant(c.name(), newFixnum(c.value())); |
| | ||||||||||||
|
| 7 | createSysErr(c.value(), c.name()); |
Row | Violation |
---|---|
1 | Type E of variable e does not match with type com.kenai.constantine.platform.Errno of variable e |
2 | Unmatched statement module.fastSetConstant(c.name(),newFixnum(c.value())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement createSysErr(c.value(),c.name()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |