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;
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;
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/FastLongMethodFactory.java
Method name: boolean isFastLongResult(Type) Method name: boolean isFastLongParam(Type)
Number of AST nodes: 18 Number of AST nodes: 15
1
if (type instanceof Type.Builtin) {
1
if (paramType instanceof Type.Builtin) {
2
            switch (type.getNativeType()) {
2
            switch (paramType.getNativeType()) {
3
                case VOID:
4
                case BOOL:
3
                case BOOL:
5
                case CHAR:
4
                case CHAR:
6
                case UCHAR:
5
                case UCHAR:
7
                case SHORT:
6
                case SHORT:
8
                case USHORT:
7
                case USHORT:
9
                case INT:
8
                case INT:
10
                case UINT:
9
                case UINT:
11
                case LONG_LONG:
10
                case LONG_LONG:
12
                case ULONG_LONG:
11
                case ULONG_LONG:
13
                case POINTER:
14
                case STRING:
15
                case LONG:
12
                case LONG:
16
                case ULONG:
13
                case ULONG:
17
                    return true;
14
                    return true;
18
            }
15
            }
19
        }
16
        }
20
        return false;
17
        return false;
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.7
Clones locationClones are declared in the same class
Number of node comparisons84
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (type instanceof Type.Builtin)
    1
    if (type instanceof Type.Builtin)
    1
    if (paramType instanceof Type.Builtin)
    Differences
    Expression1Expression2Difference
    typeparamTypeVARIABLE_NAME_MISMATCH
    1
    if (paramType instanceof Type.Builtin)
    2
    switch (type.getNativeType())
    2
    switch (type.getNativeType())
    2
    switch (paramType.getNativeType())
    Differences
    Expression1Expression2Difference
    typeparamTypeVARIABLE_NAME_MISMATCH
    2
    switch (paramType.getNativeType())
    3
    case VOID:
    3
    case VOID:
    3
    case BOOL:
    Differences
    Expression1Expression2Difference
    VOIDBOOLVARIABLE_NAME_MISMATCH
    3
    case BOOL:
    4
    case BOOL:
    4
    case BOOL:
    4
    case CHAR:
    Differences
    Expression1Expression2Difference
    BOOLCHARVARIABLE_NAME_MISMATCH
    4
    case CHAR:
    5
    case CHAR:
    5
    case CHAR:
    5
    case UCHAR:
    Differences
    Expression1Expression2Difference
    CHARUCHARVARIABLE_NAME_MISMATCH
    5
    case UCHAR:
    6
    case UCHAR:
    6
    case UCHAR:
    6
    case SHORT:
    Differences
    Expression1Expression2Difference
    UCHARSHORTVARIABLE_NAME_MISMATCH
    6
    case SHORT:
    7
    case SHORT:
    7
    case SHORT:
    7
    case USHORT:
    Differences
    Expression1Expression2Difference
    SHORTUSHORTVARIABLE_NAME_MISMATCH
    7
    case USHORT:
    8
    case USHORT:
    8
    case USHORT:
    8
    case INT:
    Differences
    Expression1Expression2Difference
    USHORTINTVARIABLE_NAME_MISMATCH
    8
    case INT:
    9
    case INT:
    9
    case INT:
    9
    case UINT:
    Differences
    Expression1Expression2Difference
    INTUINTVARIABLE_NAME_MISMATCH
    9
    case UINT:
    10
    case UINT:
    10
    case UINT:
    10
    case LONG_LONG:
    Differences
    Expression1Expression2Difference
    UINTLONG_LONGVARIABLE_NAME_MISMATCH
    10
    case LONG_LONG:
    11
    case LONG_LONG:
    11
    case LONG_LONG:
    11
    case ULONG_LONG:
    Differences
    Expression1Expression2Difference
    LONG_LONGULONG_LONGVARIABLE_NAME_MISMATCH
    11
    case ULONG_LONG:
    12
    case ULONG_LONG:
    12
    case ULONG_LONG:
    12
    case LONG:
    Differences
    Expression1Expression2Difference
    ULONG_LONGLONGVARIABLE_NAME_MISMATCH
    12
    case LONG:
    13
    case POINTER:
    13
    case POINTER:
    13
    case ULONG:
    Differences
    Expression1Expression2Difference
    POINTERULONGVARIABLE_NAME_MISMATCH
    13
    case ULONG:
    14
    case STRING:
                                    
    15
    case LONG:
                                
    16
    case ULONG:
                                  
    17
    return true;
    14
    return true;
    18
    return false;
    15
    return false;
    Precondition Violations (0)
    Row Violation