if (desc.actualRequired <= 3) {
// actual required is less than 3, so we use specific arity
specificArity = desc.actualRequired;
} else {
// actual required is greater than 3, raise error (we don't support actual required > 3)
throw new RuntimeException("Invalid specific-arity number of arguments (" + desc.actualRequired + ") on method " + desc.declaringClassName + "." + desc.name);
}
if (desc.actualRequired <= 3) {
specificArity = desc.actualRequired;
} else {
specificArity = -1;
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/InvocationMethodFactory.java
|
|
File path: /jruby-1.4.0/src/org/jruby/internal/runtime/methods/InvocationMethodFactory.java
|
Method name: void DescriptorInfo(List)
|
|
Method name: Class getAnnotatedMethodClass(List)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (desc.actualRequired <= 3) {↵ | | 1 | if (desc.actualRequired <= 3) {↵
|
2 | // actual required is less than 3, so we use specific arity↵ | | |
|
3 | specificArity = desc.actualRequired;↵ | | 2 | specificArity = desc.actualRequired;↵
|
4 | } else {↵ | | 3 | } else {↵
|
5 | // actual required is greater than 3, raise error (we don't support actual required > 3)↵ | | 4 | ↵
|
6 | throw new RuntimeException("Invalid specific-arity number of arguments (" + desc.actualRequired + ") on method " + desc.declaringClassName + "." + desc.name);↵ | | 5 | specificArity = -1;↵
|
7 | } | | 6 | }
|
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 java file |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
16 | if (desc.actualRequired <= 3) | | 38 | if (desc.actualRequired <= 3) |
17 | specificArity = desc.actualRequired; | | 39 | specificArity = desc.actualRequired; |
| | | | |
18 | throw new RuntimeException("Invalid specific-arity number of arguments (" + desc.actualRequired + ") on method " + desc.declaringClassName + "." + desc.name); | | | |
| | | 40 | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement throw new RuntimeException("Invalid specific-arity number of arguments (" + desc.actualRequired + ") on method "+ desc.declaringClassName+ "."+ desc.name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched throw new RuntimeException("Invalid specific-arity number of arguments (" + desc.actualRequired + ") on method "+ desc.declaringClassName+ "."+ desc.name); |