if (isStatic) args--;
if (hasContext) args--;
if (hasBlock) args--;
// minus one more for IRubyObject[]
args--;
// TODO: confirm expected args are IRubyObject (or similar)
actualRequired = args;
if (isStatic) args--;
if (hasContext) args--;
if (hasBlock) args--;
// TODO: confirm expected args are IRubyObject (or similar)
actualRequired = args;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/anno/JavaMethodDescriptor.java
|
|
File path: /jruby-1.4.0/src/org/jruby/anno/JavaMethodDescriptor.java
|
Method name: void JavaMethodDescriptor(Method)
|
|
Method name: void JavaMethodDescriptor(Method)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 7
|
|
1 | if (isStatic) args--;↵ | | 1 | if (isStatic) args--;↵
|
2 | if (hasContext) args--;↵ | | 2 | if (hasContext) args--;↵
|
3 | if (hasBlock) args--;↵ | | 3 | if (hasBlock) args--;↵
|
|
4 | // minus one more for IRubyObject[]↵ | | |
|
5 | args--;↵ | | |
|
|
6 | // TODO: confirm expected args are IRubyObject (or similar)↵ | | 4 | // TODO: confirm expected args are IRubyObject (or similar)↵
|
7 | actualRequired = args; | | 5 | actualRequired = args;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 29 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
43 | if (isStatic) | | 33 | if (isStatic) |
44 | | | 34 | |
45 | if (hasContext) | | 35 | if (hasContext) |
46 | | | 36 | |
47 | if (hasBlock) | | 37 | if (hasBlock) |
48 | | | 38 | |
49 | args--; | | | |
50 | actualRequired = args; | | 39 | actualRequired = args; |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement args--; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables args , while Clone fragment #2 returns variables |