File path: /jruby-1.4.0/src/org/jruby/RubyJRuby.java | File path: /jruby-1.4.0/src/org/jruby/runtime/load/LoadServiceResource.java | |||
Method name: IRubyObject getDefaultProc(ThreadContext)
|
Method name: URL getURL()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (default_proc != null) {↵ | 1 | if (resource != null) {↵ | |
2 | return default_proc;↵ | 2 | return ↵ | |
3 | ↵ | 3 | resource;↵ | |
4 | } else {↵ | 4 | } else {↵ | |
5 | return context.getRuntime().getNil();↵ | 5 | return ↵ | |
6 | ↵ | 6 | path.toURI().toURL();↵ | |
7 | } | 7 |
| |
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (default_proc != null) |
| 1 | if (resource != null) | ||||||||||||||
|
| 2 | return resource; | |||||||||||||||
2 | return default_proc; |
| | |||||||||||||||
else | | |||||||||||||||||
|
| 3 | return path.toURI().toURL(); | |||||||||||||||
3 | return context.getRuntime().getNil(); |
| |
Row | Violation |
---|---|
1 | Type org.jruby.RubyProc of variable default_proc does not match with type java.net.URL of variable resource |
2 | Unmatched return resource; |
3 | Unmatched return default_proc; |
4 | Unmatched return path.toURI().toURL(); |
5 | Unmatched return context.getRuntime().getNil(); |