synchronized(classProviders) {
if (!classProviders.contains(provider)) {
classProviders.add(provider);
}
}
if(profile.allowBuiltin(name)) {
loadService.addBuiltinLibrary(name,lib);
}
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/Ruby.java
|
Method name: void addClassProvider(ClassProvider)
|
|
Method name: void addBuiltinIfAllowed(String, Library)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 2
|
|
1 | synchronized(classProviders) {↵ | | |
|
2 | if (!classProviders.contains(provider)) {↵ | | 1 | if(profile.allowBuiltin(name)) {↵
|
3 | classProviders.add(provider);↵ | | 2 | ↵
|
4 | }↵ | | |
|
5 | ↵ | | 3 | loadService.addBuiltinLibrary(name,lib);↵
|
6 | } | | 4 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 4 |
-
{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) | 1.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | if (!classProviders.contains(provider)) | | 1 | if (profile.allowBuiltin(name)) |
| | | 2 | loadService.addBuiltinLibrary(name, lib); |
7 | classProviders.add(provider); | | | |
Precondition Violations (0)
Row |
Violation |