if (p != null) {
if (p.isSealed()) {
throw runtime.newTypeError("package " + p + " is sealed");
}
}
for (RubyModule p = getSuperClass(); p != null; p = p.getSuperClass()) {
if (p.isIncluded()) {
ary.append(p.getNonIncludedClass());
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/proxy/JavaProxyClassFactory.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyModule.java
|
Method name: void validateArgs(Ruby, String, Class)
|
|
Method name: RubyArray included_modules(ThreadContext)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (p != null) {↵ | | 1 | for (RubyModule p = getSuperClass(); p != null; p = p.getSuperClass()) {↵
|
2 | if (p.isSealed()) {↵ | | 2 | if (p.isIncluded()) {↵
|
3 | throw runtime.newTypeError("package " + p + " is sealed");↵ | | 3 | ary.append(p.getNonIncludedClass());↵
|
4 | }↵ | | 4 | }↵
|
5 | } | | 5 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | if (p.isSealed()) | | 3 | if (p.isIncluded()) |
| | | 4 | ary.append(p.getNonIncludedClass()); |
10 | throw runtime.newTypeError("package " + p + " is sealed"); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.lang.Package of variable p does not match with type org.jruby.RubyModule of variable p |
2 | Unmatched throw runtime.newTypeError("package " + p + " is sealed"); |