File path: /jruby-1.4.0/src/org/jruby/RubyMarshal.java | File path: /jruby-1.4.0/src/org/jruby/RubyMarshal.java | |||
Method name: InputStream inputStream(IRubyObject)
|
Method name: OutputStream outputStream(IRubyObject)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | setBinmodeIfPossible(in);↵ | 1 | setBinmodeIfPossible(out);↵ | |
2 | if (in instanceof RubyIO) {↵ | 2 | if (out instanceof RubyIO) {↵ | |
3 | return ((RubyIO) in).getInStream();↵ | 3 | return ((RubyIO) out).getOutStream();↵ | |
4 | }↵ | 4 | }↵ | |
5 | return new IOInputStream(in); | 5 | return new IOOutputStream(out); | |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
Number of mapped statements | 2 |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | setBinmodeIfPossible(in); |
| 1 | setBinmodeIfPossible(out); | ||||||||||
2 | if (in instanceof RubyIO) |
| 2 | if (out instanceof RubyIO) | ||||||||||
|
| 3 | return ((RubyIO)out).getOutStream(); | |||||||||||
3 | return ((RubyIO)in).getInStream(); |
| | |||||||||||
|
| 4 | return new IOOutputStream(out); | |||||||||||
4 | return new IOInputStream(in); |
| |
Row | Violation |
---|---|
1 | Unmatched return ((RubyIO)out).getOutStream(); |
2 | Unmatched return ((RubyIO)in).getInStream(); |
3 | Unmatched return new IOOutputStream(out); |
4 | Unmatched return new IOInputStream(in); |