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; }
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; } }
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 isFastLongParam(Type)
Number of AST nodes: 17 Number of AST nodes: 14
1
if (paramType instanceof Type.Builtin) {
1
switch (type.getNativeType()) {
2
            switch (paramType.getNativeType()) {
3
                case BOOL:
2
                case CHAR:
4
                case CHAR:
3
                case UCHAR:
5
                case UCHAR:
4
                case SHORT:
6
                case SHORT:
5
                case USHORT:
7
                case USHORT:
6
                case INT:
8
                case INT:
7
                case UINT:
9
                case UINT:
8
                case LONG:
9
                case ULONG:
10
                case LONG_LONG:
10
                case LONG_LONG:
11
                case ULONG_LONG:
11
                case ULONG_LONG:
12
                case FLOAT:
12
                case LONG:
13
                case DOUBLE:
13
                case 
14
                case POINTER:
15
                case STRING:
16
                case BOOL:
14
ULONG:
17
                    return true;
15
                    return true;
18
            }
16
            }
17
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons81
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    switch (type.getNativeType())
    2
    switch (type.getNativeType())
    2
    switch (paramType.getNativeType())
    Differences
    Expression1Expression2Difference
    typeparamTypeVARIABLE_NAME_MISMATCH
    2
    switch (paramType.getNativeType())
    3
    case CHAR:
    4
    case CHAR:
    4
    case UCHAR:
    5
    case UCHAR:
    5
    case SHORT:
    6
    case SHORT:
    6
    case USHORT:
    7
    case USHORT:
    7
    case INT:
    8
    case INT:
    8
    case UINT:
    9
    case UINT:
    9
    case LONG:
    12
    case LONG:
    10
    case ULONG:
    13
    case ULONG:
    11
    case LONG_LONG:
    10
    case LONG_LONG:
    12
    case ULONG_LONG:
    11
    case ULONG_LONG:
    13
    case FLOAT:
    13
    case FLOAT:
    3
    case BOOL:
    Differences
    Expression1Expression2Difference
    FLOATBOOLVARIABLE_NAME_MISMATCH
    3
    case BOOL:
    14
    case DOUBLE:
                                    
    15
    case POINTER:
                                      
    16
    case STRING:
                                    
    17
    case BOOL:
                                
    18
    return true;
    14
    return true;
    Precondition Violations (0)
    Row Violation