if (type instanceof Type.Builtin) {
switch (type.getNativeType()) {
case CHAR:
case UCHAR:
case SHORT:
case USHORT:
case INT:
case UINT:
case LONG:
case ULONG:
case LONG_LONG:
case ULONG_LONG:
case FLOAT:
case DOUBLE:
case POINTER:
case STRING:
case BOOL:
return true;
}
} else if (type instanceof CallbackInfo) {
return true;
}
return false;
if (type instanceof Type.Builtin) {
switch (type.getNativeType()) {
case VOID:
case BOOL:
case CHAR:
case UCHAR:
case SHORT:
case USHORT:
case INT:
case UINT:
case LONG_LONG:
case ULONG_LONG:
case POINTER:
case STRING:
case LONG:
case ULONG:
return true;
}
}
return false;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/CallbackManager.java
|
|
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastLongMethodFactory.java
|
Method name: boolean isParameterTypeValid(Type)
|
|
Method name: boolean isFastLongResult(Type)
|
Number of AST nodes: 21
|
|
Number of AST nodes: 18
|
|
1 | if (type instanceof Type.Builtin) {↵ | | 1 | if (type instanceof Type.Builtin) {↵
|
2 | switch (type.getNativeType()) {↵ | | 2 | switch (type.getNativeType()) {↵
|
| | | 3 | case VOID:↵
|
| | | 4 | case BOOL:↵
|
3 | case CHAR:↵ | | 5 | case CHAR:↵
|
4 | case UCHAR:↵ | | 6 | case UCHAR:↵
|
5 | case SHORT:↵ | | 7 | case SHORT:↵
|
6 | case USHORT:↵ | | 8 | case USHORT:↵
|
7 | case INT:↵ | | 9 | case INT:↵
|
8 | case UINT:↵ | | 10 | case UINT:↵
|
9 | case LONG:↵ | | |
|
10 | case ULONG:↵ | | |
|
11 | case LONG_LONG:↵ | | 11 | case LONG_LONG:↵
|
12 | case ULONG_LONG:↵ | | 12 | case ULONG_LONG:↵
|
13 | case FLOAT:↵ | | 13 | case ↵
|
14 | case DOUBLE:↵ | | 14 | POINTER:↵
|
15 | case POINTER:↵ | | 15 | case STRING:↵
|
16 | case STRING:↵ | | 16 | case LONG:↵
|
17 | case BOOL:↵ | | 17 | case ULONG:↵
|
18 | return true;↵ | | 18 | return true;↵
|
19 | }↵ | | 19 | }↵
|
20 | } else if (type instanceof CallbackInfo) {↵ | | |
|
21 | return true;↵ | | |
|
22 | }↵ | | 20 | }↵
|
23 | return false; | | 21 | return false;
|
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.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 117 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 16 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 8.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | switch (type.getNativeType()) | | 2 | switch (type.getNativeType()) |
3 | | | 5 | |
4 | | | 6 | |
5 | | | 7 | |
6 | | | 8 | |
7 | | | 9 | |
8 | | | 10 | |
9 | | | 15 | |
10 | | | 16 | |
11 | | | 11 | |
12 | | | 12 | |
13 | | | 13 | |
14 | | | 14 | |
15 | | | 4 | |
16 | | | 3 | |
17 | | | | |
18 | | | 17 | |
Precondition Violations (0)
Row |
Violation |