if (type instanceof Type.Builtin) { switch (type.getNativeType()) { case VOID: case CHAR: case UCHAR: case SHORT: case USHORT: case INT: case UINT: case BOOL: return true; case POINTER: case STRING: return Platform.getPlatform().addressSize() == 32; case LONG: case ULONG: return Platform.getPlatform().longSize() == 32; } } 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/FastIntMethodFactory.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastIntMethodFactory.java
Method name: boolean isFastIntResult(Type) Method name: boolean isFastIntParam(Type)
Number of AST nodes: 18 Number of AST nodes: 14
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 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 BOOL:
9
                case BOOL:
10
//                case FLOAT:
11
                    return true;
11
                    return true
12
                case POINTER:
13
                case STRING:
14
                    return Platform.getPlatform().addressSize() == 32;
12
;
15
                case LONG:
13
                case LONG:
16
                case ULONG:
14
                case ULONG:
17
                    return Platform.getPlatform().longSize() == 32;
15
                    return Platform.getPlatform().longSize() == 32;
18
            }
16
            }
19
        }
17
        }
20
        return false;
18
        return false;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are declared in the same class
Number of node comparisons71
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.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 CHAR:
    Differences
    Expression1Expression2Difference
    VOIDCHARVARIABLE_NAME_MISMATCH
    3
    case CHAR:
    4
    case CHAR:
    4
    case CHAR:
    4
    case UCHAR:
    Differences
    Expression1Expression2Difference
    CHARUCHARVARIABLE_NAME_MISMATCH
    4
    case UCHAR:
    5
    case UCHAR:
    5
    case UCHAR:
    5
    case SHORT:
    Differences
    Expression1Expression2Difference
    UCHARSHORTVARIABLE_NAME_MISMATCH
    5
    case SHORT:
    6
    case SHORT:
    6
    case SHORT:
    6
    case USHORT:
    Differences
    Expression1Expression2Difference
    SHORTUSHORTVARIABLE_NAME_MISMATCH
    6
    case USHORT:
    7
    case USHORT:
    7
    case USHORT:
    7
    case INT:
    Differences
    Expression1Expression2Difference
    USHORTINTVARIABLE_NAME_MISMATCH
    7
    case INT:
    8
    case INT:
    8
    case INT:
    8
    case UINT:
    Differences
    Expression1Expression2Difference
    INTUINTVARIABLE_NAME_MISMATCH
    8
    case UINT:
    9
    case UINT:
    9
    case UINT:
    9
    case BOOL:
    Differences
    Expression1Expression2Difference
    UINTBOOLVARIABLE_NAME_MISMATCH
    9
    case BOOL:
    10
    case BOOL:
    10
    case BOOL:
    12
    case ULONG:
    Differences
    Expression1Expression2Difference
    BOOLULONGVARIABLE_NAME_MISMATCH
    12
    case ULONG:
    11
    return true;
    11
    return true;
    13
    return Platform.getPlatform().longSize() == 32;
    Differences
    Expression1Expression2Difference
    truePlatform.getPlatform().longSize() == 32TYPE_COMPATIBLE_REPLACEMENT
    13
    return Platform.getPlatform().longSize() == 32;
    12
    case POINTER:
    12
    case POINTER:
    11
    case LONG:
    Differences
    Expression1Expression2Difference
    POINTERLONGVARIABLE_NAME_MISMATCH
    11
    case LONG:
    13
    case STRING:
                                    
    14
    return Platform.getPlatform().addressSize() == 32;
    14
    return Platform.getPlatform().addressSize() == 32;
    10
    return true;
    Differences
    Expression1Expression2Difference
    Platform.getPlatform().addressSize() == 32trueTYPE_COMPATIBLE_REPLACEMENT
    10
    return true;
    15
    case LONG:
                                
    16
    case ULONG:
                                  
    17
    return Platform.getPlatform().longSize() == 32;
    17
    return Platform.getPlatform().longSize() == 32;
    Preondition Violations
    Unmatched return Platform.getPlatform().longSize() == 32;
                                                                                                          
    18
    return false;
    14
    return false;
    Precondition Violations (1)
    Row Violation
    1Unmatched return Platform.getPlatform().longSize() == 32;