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;
}
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;
}
}
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/FastLongMethodFactory.java
|
Method name: boolean needsDefinitionCheck(Node)
|
|
Method name: boolean isFastLongParam(Type)
|
Number of AST nodes: 21
|
|
Number of AST nodes: 14
|
|
1 | switch (nod↵ | | 1 | if (paramType instanceof Type.Builtin) {↵
|
2 | e.getNodeType()) {↵ | | 2 | switch (paramType.getNativeType()) {↵
|
3 | case CLASSVARASGNNODE:↵ | | 3 | ↵
|
4 | case CLASSVARDECLNODE:↵ | | |
|
5 | case CONSTDECLNODE:↵ | | |
|
| | | 4 | case BOOL:↵
|
6 | case DASGNNODE:↵ | | 5 | case CHAR:↵
|
7 | case GLOBALASGNNODE:↵ | | 6 | ↵
|
8 | case LOCALASGNNODE:↵ | | |
|
9 | case MULTIPLEASGNNODE:↵ | | |
|
10 | case OPASGNNODE:↵ | | |
|
11 | case OPELEMENTASGNNODE:↵ | | |
|
| | | 7 | case UCHAR:↵
|
| | | 8 | case SHORT:↵
|
12 | case DVARNODE:↵ | | 9 | case USHORT:↵
|
13 | case FALSENODE:↵ | | 10 | ↵
|
14 | case TRUENODE:↵ | | 11 | case INT:↵
|
15 | case LOCALVARNODE:↵ | | 12 | ↵
|
16 | case MATCH2NODE:↵ | | |
|
17 | case MATCH3NODE:↵ | | |
|
18 | case NILNODE:↵ | | |
|
| | | 13 | case UINT:↵
|
| | | 14 | case LONG_LONG:↵
|
19 | case SELFNODE:↵ | | 15 | case ULONG_LONG:↵
|
20 | // all these types are immediately considered "defined"↵ | | 16 | ↵
|
21 | return false;↵ | | |
|
22 | default:↵ | | |
|
| | | 17 | case LONG:↵
|
| | | 18 | case ULONG:↵
|
23 | return true;↵ | | 19 | return true;↵
|
| | | 20 | }↵
|
24 | } | | 21 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |