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;
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/FastLongMethodFactory.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/FastIntMethodFactory.java
Method name: boolean isFastLongParam(Type) Method name: boolean isFastIntParam(Type)
Number of AST nodes: 15 Number of AST nodes: 14
1
if (paramType instanceof Type.Builtin) {
1
if (paramType instanceof Type.Builtin) {
2
            switch (paramType.getNativeType()) {
2
            switch (paramType.getNativeType()) {
3
                case BOOL:
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 LONG_LONG:
9
                case 
10
BOOL:
11
                case ULONG_LONG:
11
//                case FLOAT:
12
                    return true;
12
                case LONG:
13
                case LONG:
13
                case ULONG:
14
                case ULONG:
14
                    return true;
15
                    return Platform.getPlatform().longSize() == 32;
15
            }
16
            }
16
        }
17
        }
17
        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 comparisons64
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (paramType instanceof Type.Builtin)
    1
    if (paramType instanceof Type.Builtin)
    2
    switch (paramType.getNativeType())
    2
    switch (paramType.getNativeType())
    3
    case BOOL:
    9
    case BOOL:
    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 LONG_LONG:
    10
    case LONG_LONG:
    11
    case LONG:
    Differences
    Expression1Expression2Difference
    LONG_LONGLONGVARIABLE_NAME_MISMATCH
    11
    case LONG:
    11
    case ULONG_LONG:
    11
    case ULONG_LONG:
    12
    case ULONG:
    Differences
    Expression1Expression2Difference
    ULONG_LONGULONGVARIABLE_NAME_MISMATCH
    12
    case ULONG:
    12
    case LONG:
                                
    13
    case ULONG:
                                  
    14
    return true;
    10
    return true;
                                                                                                          
    13
    return Platform.getPlatform().longSize() == 32;
    Preondition Violations
    Unmatched return Platform.getPlatform().longSize() == 32;
    13
    return Platform.getPlatform().longSize() == 32;
    15
    return false;
    14
    return false;
    Precondition Violations (1)
    Row Violation
    1Unmatched return Platform.getPlatform().longSize() == 32;