if (paramType instanceof Type.Builtin) {
switch (paramType.getNativeType()) {
case BOOL:
case CHAR:
case UCHAR:
case SHORT:
case USHORT:
case INT:
case UINT:
case LONG_LONG:
case ULONG_LONG:
case LONG:
case ULONG:
return true;
}
}
return false;
if (paramType instanceof Type.Builtin) {
switch (paramType.getNativeType()) {
case CHAR:
case UCHAR:
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOL:
// case FLOAT:
return true;
case LONG:
case ULONG:
return Platform.getPlatform().longSize() == 32;
}
}
return false;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastLongMethodFactory.java
|
|
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastIntMethodFactory.java
|
Method name: boolean isFastLongParam(Type)
|
|
Method name: boolean isFastIntParam(Type)
|
Number of AST nodes: 15
|
|
Number of AST nodes: 14
|
|
1 | if (paramType instanceof Type.Builtin) {↵ | | 1 | if (paramType instanceof Type.Builtin) {↵
|
2 | switch (paramType.getNativeType()) {↵ | | 2 | switch (paramType.getNativeType()) {↵
|
3 | case BOOL:↵ | | |
|
4 | case CHAR:↵ | | 3 | case CHAR:↵
|
5 | case UCHAR:↵ | | 4 | case UCHAR:↵
|
6 | case SHORT:↵ | | 5 | case SHORT:↵
|
7 | case USHORT:↵ | | 6 | case USHORT:↵
|
8 | case INT:↵ | | 7 | case INT:↵
|
9 | case UINT:↵ | | 8 | case UINT:↵
|
10 | case LONG_LONG:↵ | | 9 | case ↵
|
| | | 10 | BOOL:↵
|
11 | case ULONG_LONG:↵ | | 11 | // case FLOAT:↵
|
| | | 12 | return true;↵
|
12 | case LONG:↵ | | 13 | case LONG:↵
|
13 | case ULONG:↵ | | 14 | case ULONG:↵
|
14 | return true;↵ | | 15 | return Platform.getPlatform().longSize() == 32;↵
|
15 | }↵ | | 16 | }↵
|
16 | }↵ | | 17 | }↵
|
17 | return false; | | 18 | return false;
|
See real code fragment |
|
See real code fragment |
Summary
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 in different classes |
Number of node comparisons | 64 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 4.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (paramType instanceof Type.Builtin) | | 1 | if (paramType instanceof Type.Builtin) |
2 | switch (paramType.getNativeType()) | | 2 | switch (paramType.getNativeType()) |
3 | | | 9 | |
4 | | | 3 | |
5 | | | 4 | |
6 | | | 5 | |
7 | | | 6 | |
8 | | | 7 | |
9 | | | 8 | |
10 | | | 11 | |
11 | | | 12 | |
12 | | | | |
13 | | | | |
14 | | | 10 | |
| | | 13 | return Platform.getPlatform().longSize() == 32; |
15 | return false; | | 14 | return false; |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched return Platform.getPlatform().longSize() == 32; |