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 (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;
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/FastIntMethodFactory.java
Method name: boolean isFastLongResult(Type) Method name: boolean isFastIntResult(Type)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (type instanceof Type.Builtin) {
1
if (type instanceof Type.Builtin) {
2
            switch (type.getNativeType()) {
2
            switch (type.getNativeType()) {
3
                case VOID:
3
                case VOID:
4
                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 BOOL:
12
                case ULONG_LONG:
11
                    return true;
13
                case POINTER:
12
                case POINTER:
14
                case STRING:
13
                case STRING:
14
                    return Platform.getPlatform().addressSize() == 32;
15
                case LONG:
15
                case LONG:
16
                case ULONG:
16
                case ULONG:
17
                    return true;
17
                    return Platform.getPlatform().longSize() == 32;
18
            }
18
            }
19
        }
19
        }
20
        return false;
20
        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 comparisons114
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)7.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (type instanceof Type.Builtin)
    1
    if (type instanceof Type.Builtin)
    2
    switch (type.getNativeType())
    2
    switch (type.getNativeType())
    3
    case VOID:
    3
    case VOID:
    4
    case BOOL:
    10
    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:
    11
    case LONG_LONG:
    12
    case POINTER:
    Differences
    Expression1Expression2Difference
    LONG_LONGPOINTERVARIABLE_NAME_MISMATCH
    12
    case POINTER:
    12
    case ULONG_LONG:
    12
    case ULONG_LONG:
    13
    case STRING:
    Differences
    Expression1Expression2Difference
    ULONG_LONGSTRINGVARIABLE_NAME_MISMATCH
    13
    case STRING:
                                                                                                                
    14
    return Platform.getPlatform().addressSize() == 32;
    Preondition Violations
    Unmatched return Platform.getPlatform().addressSize() == 32;
    14
    return Platform.getPlatform().addressSize() == 32;
    13
    case POINTER:
    13
    case POINTER:
    15
    case LONG:
    Differences
    Expression1Expression2Difference
    POINTERLONGVARIABLE_NAME_MISMATCH
    15
    case LONG:
    14
    case STRING:
    14
    case STRING:
    16
    case ULONG:
    Differences
    Expression1Expression2Difference
    STRINGULONGVARIABLE_NAME_MISMATCH
    16
    case ULONG:
    15
    case LONG:
                                
    16
    case ULONG:
                                  
    17
    return true;
    11
    return true;
                                                                                                          
    17
    return Platform.getPlatform().longSize() == 32;
    Preondition Violations
    Unmatched return Platform.getPlatform().longSize() == 32;
    17
    return Platform.getPlatform().longSize() == 32;
    18
    return false;
    18
    return false;
    Precondition Violations (2)
    Row Violation
    1Unmatched return Platform.getPlatform().addressSize() == 32;
    2Unmatched return Platform.getPlatform().longSize() == 32;