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 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/FastIntMethodFactory.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastLongMethodFactory.java
Method name: boolean isFastIntResult(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:
3
                case BOOL:
4
                case CHAR:
4
                case CHAR:
5
                case UCHAR:
5
                case UCHAR:
6
                case SHORT:
6
                case SHORT:
7
                case USHORT:
7
                case USHORT:
8
                case INT:
8
                case INT:
9
                case UINT:
9
                case UINT:
10
                case BOOL:
10
                case 
11
                    return true;
12
                case POINTER:
13
                case STRING:
14
                    return Platform.getPlatform().addressSize() == 32;
11
LONG_LONG:
12
                case ULONG_LONG:
15
                case LONG:
13
                case LONG:
16
                case ULONG:
14
                case ULONG:
17
                    return Platform.getPlatform().longSize() == 32;
15
                    return true;
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.5
Clones locationClones are in different classes
Number of node comparisons84
  1. {Non-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)7.2
    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 CHAR:
    4
    case CHAR:
    5
    case UCHAR:
    5
    case UCHAR:
    6
    case SHORT:
    6
    case SHORT:
    7
    case USHORT:
    7
    case USHORT:
    8
    case INT:
    8
    case INT:
    9
    case UINT:
    9
    case UINT:
    10
    case BOOL:
    10
    case BOOL:
    13
    case ULONG:
    Differences
    Expression1Expression2Difference
    BOOLULONGVARIABLE_NAME_MISMATCH
    13
    case ULONG:
    11
    return true;
    14
    return true;
    12
    case POINTER:
    12
    case POINTER:
    12
    case LONG:
    Differences
    Expression1Expression2Difference
    POINTERLONGVARIABLE_NAME_MISMATCH
    12
    case LONG:
    13
    case STRING:
    13
    case STRING:
    11
    case ULONG_LONG:
    Differences
    Expression1Expression2Difference
    STRINGULONG_LONGVARIABLE_NAME_MISMATCH
    11
    case ULONG_LONG:
    14
    return Platform.getPlatform().addressSize() == 32;
    14
    return Platform.getPlatform().addressSize() == 32;
    Preondition Violations
    Unmatched return Platform.getPlatform().addressSize() == 32;
                                                                                                                
    15
    case LONG:
    15
    case LONG:
    10
    case LONG_LONG:
    Differences
    Expression1Expression2Difference
    LONGLONG_LONGVARIABLE_NAME_MISMATCH
    10
    case LONG_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;
    15
    return false;
    Precondition Violations (2)
    Row Violation
    1Unmatched return Platform.getPlatform().addressSize() == 32;
    2Unmatched return Platform.getPlatform().longSize() == 32;