switch (node.getNodeType()) { case CLASSVARASGNNODE: case CLASSVARDECLNODE: case CONSTDECLNODE: case DASGNNODE: case GLOBALASGNNODE: case LOCALASGNNODE: case MULTIPLEASGNNODE: case OPASGNNODE: case OPELEMENTASGNNODE: case DVARNODE: case FALSENODE: case TRUENODE: case LOCALVARNODE: case MATCH2NODE: case MATCH3NODE: case NILNODE: case SELFNODE: // all these types are immediately considered "defined" return false; default: return true; }
switch (type.getNativeType()) { case CHAR: case UCHAR: case SHORT: case USHORT: case INT: case UINT: case LONG: case ULONG: case LONG_LONG: case ULONG_LONG: case FLOAT: case DOUBLE: case POINTER: case VOID: case BOOL: return true; }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/CallbackManager.java
Method name: boolean needsDefinitionCheck(Node) Method name: boolean isReturnTypeValid(Type)
Number of AST nodes: 21 Number of AST nodes: 17
1
switch (node.getNodeType()) {
1
switch (type.getNativeType()) {
2
        case CLASSVARASGNNODE:
2
         
3
       case CHAR:
3
        case CLASSVARDECLNODE:
4
                case 
5
UCHAR:
4
        case CONSTDECLNODE:
6
                case 
7
SHORT:
5
        case DASGNNODE:
8
                case 
6
        case GLOBALASGNNODE:
7
        case LOCALASGNNODE:
8
        case MULTIPLEASGNNODE:
9
USHORT:
10
                case INT:
11
                case UINT:
9
        case OPASGNNODE:
12
                case 
13
LONG:
10
        case OPELEMENTASGNNODE:
14
           
11
        case DVARNODE:
12
        case FALSENODE:
15
     case ULONG:
16
                case LONG_LONG:
13
        case TRUENODE:
17
           
18
     case ULONG_LONG:
14
        case LOCALVARNODE:
19
                case FLO
15
        case MATCH2NODE:
20
AT:
16
        case MATCH3NODE:
21
                case DOUBLE:
17
        case NILNODE:
22
        
18
        case SELFNODE:
23
        case POINTER:
19
            // all these types are immediately considered "defined"
24
            
20
            return false;
21
        default:
25
    case VOID:
26
                case BOOL:
22
            return true;
27
                    return true;
23
        }
28
            }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons1