switch (this) {
case TRUENODE:
case FIXNUMNODE:
case FLOATNODE:
case REGEXPNODE:
case STRNODE:
case DOTNODE:
case SYMBOLNODE:
case BIGNUMNODE:
case ARRAYNODE:
case HASHNODE:
return true;
default:
return false;
}
switch (this) {
case FIXNUMNODE:
case STRNODE:
case FLOATNODE:
case BIGNUMNODE:
case SELFNODE:
case TRUENODE:
case FALSENODE:
case NILNODE:
return true;
default:
return false;
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ast/NodeType.java
|
|
File path: /jruby-1.4.0/src/org/jruby/ast/NodeType.java
|
Method name: boolean alwaysTrue()
|
|
Method name: boolean isImmediate()
|
Number of AST nodes: 14
|
|
Number of AST nodes: 12
|
|
1 | switch (this) {↵ | | 1 | switch (this) {↵
|
2 | case TRUENODE:↵ | | |
|
3 | case FIXNUMNODE:↵ | | 2 | case FIXNUMNODE:↵
|
4 | case FLOATNODE:↵ | | 3 | case ↵
|
5 | case REGEXPNODE:↵ | | 4 | STRNODE:↵
|
6 | case STRNODE:↵ | | 5 | case FLOATNODE:↵
|
7 | case DOTNODE:↵ | | 6 | case BIGNUMNODE:↵
|
8 | case SYMBOLNODE:↵ | | 7 | case SELFNODE:↵
|
9 | case BIGNUMNODE:↵ | | 8 | case TRUENODE:↵
|
10 | case ARRAYNODE:↵ | | 9 | case FALSENODE:↵
|
11 | case HASHNODE:↵ | | 10 | case NILNODE:↵
|
12 | return true;↵ | | 11 | return true;↵
|
13 | default:↵ | | 12 | default:↵
|
14 | return false;↵ | | 13 | return false;↵
|
15 | } | | 14 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 76 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | switch (this) | | 1 | switch (this) |
2 | | | 7 | |
3 | | | 2 | |
4 | | | 4 | |
5 | | | 5 | |
6 | | | 3 | |
7 | | | 6 | |
8 | | | 8 | |
9 | | | 9 | |
10 | | | | |
11 | | | | |
12 | | | 10 | |
13 | | | 11 | |
14 | | | 12 | |
Precondition Violations (0)
Row |
Violation |