if (method.isUndefined()) {
if (isModule()) {
method = runtime.getObject().searchMethod(oldName);
}
if (method.isUndefined()) {
throw runtime.newNameError("undefined method `" + oldName + "' for " +
(isModule() ? "module" : "class") + " `" + getName() + "'", oldName);
}
}
if (method.isUndefined()) {
if (isModule()) {
method = runtime.getObject().searchMethod(oldName);
}
if (method.isUndefined()) {
throw runtime.newNameError("undefined method `" + oldName + "' for " +
(isModule() ? "module" : "class") + " `" + getName() + "'", oldName);
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyModule.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyModule.java
|
Method name: void defineAliases(List, String)
|
|
Method name: void defineAlias(String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (method.isUndefined()) {↵ | | 1 | if (method.isUndefined()) {↵
|
2 | if (isModule()) {↵ | | 2 | if (isModule()) {↵
|
3 | method = runtime.getObject().searchMethod(oldName);↵ | | 3 | method = runtime.getObject().searchMethod(oldName);↵
|
4 | }↵ | | 4 | }↵
|
|
5 | if (method.isUndefined()) {↵ | | 5 | if (method.isUndefined()) {↵
|
6 | throw runtime.newNameError("undefined method `" + oldName + "' for " +↵ | | 6 | throw runtime.newNameError("undefined method `" + oldName + "' for " +↵
|
7 | (isModule() ? "module" : "class") + " `" + getName() + "'", oldName);↵ | | 7 | (isModule() ? "module" : "class") + " `" + getName() + "'", oldName);↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | if (method.isUndefined()) | | 10 | if (method.isUndefined()) |
7 | | | 11 | |
8 | method = runtime.getObject().searchMethod(oldName); | | 12 | method = runtime.getObject().searchMethod(oldName); |
9 | if (method.isUndefined()) | | 13 | if (method.isUndefined()) |
10 | throw runtime.newNameError("undefined method `" + oldName + "' for " + (isModule() ? "module" : "class") + " `" + getName() + "'", oldName); | | 14 | throw runtime.newNameError("undefined method `" + oldName + "' for " + (isModule() ? "module" : "class") + " `" + getName() + "'", oldName); |
Precondition Violations (0)
Row |
Violation |