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 VOID:
case BOOL:
return true;
}
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;
}
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/CallbackManager.java
|
Method name: boolean isReturnTypeValid(Type)
|
|
Method name: boolean isParameterTypeValid(Type)
|
Number of AST nodes: 17
|
|
Number of AST nodes: 17
|
|
1 | switch (type.getNativeType()) {↵ | | 1 | switch (type.getNativeType()) {↵
|
2 | case CHAR:↵ | | 2 | case CHAR:↵
|
3 | case UCHAR:↵ | | 3 | case UCHAR:↵
|
4 | case SHORT:↵ | | 4 | case SHORT:↵
|
5 | case USHORT:↵ | | 5 | case USHORT:↵
|
6 | case INT:↵ | | 6 | case INT:↵
|
7 | case UINT:↵ | | 7 | case UINT:↵
|
8 | case LONG:↵ | | 8 | case LONG:↵
|
9 | case ULONG:↵ | | 9 | case ULONG:↵
|
10 | case LONG_LONG:↵ | | 10 | case LONG_LONG:↵
|
11 | case ULONG_LONG:↵ | | 11 | case ULONG_LONG:↵
|
12 | case FLOAT:↵ | | 12 | case FLOAT:↵
|
13 | case DOUBLE:↵ | | 13 | case DOUBLE:↵
|
14 | case POINTER:↵ | | 14 | case POINTER:↵
|
15 | case VOID:↵ | | 15 | case STRING:↵
|
16 | case BOOL:↵ | | 16 | case BOOL:↵
|
17 | return true;↵ | | 17 | return true;↵
|
18 | } | | 18 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 139 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 17 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | switch (type.getNativeType()) | | 2 | switch (type.getNativeType()) |
3 | | | 3 | |
4 | | | 4 | |
5 | | | 5 | |
6 | | | 6 | |
7 | | | 7 | |
8 | | | 8 | |
9 | | | 9 | |
10 | | | 10 | |
11 | | | 11 | |
12 | | | 12 | |
13 | | | 13 | |
14 | | | 14 | |
15 | | | 15 | |
16 | | | 16 | |
17 | | | 17 | |
18 | | | 18 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return true; |
2 | Conditional return true; |