File path: /jruby-1.4.0/src/org/jruby/java/addons/IOJavaAddons.java | File path: /jruby-1.4.0/src/org/jruby/java/addons/IOJavaAddons.java | |||
Method name: IRubyObject any_to_channel(ThreadContext, IRubyObject)
|
Method name: IRubyObject any_to_channel(ThreadContext, IRubyObject)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (self.respondsTo("write") || self.respondsTo("<<")) {↵ | 1 | if (self.respondsTo("write") || self.respondsTo("<<")) {↵ | |
2 | channel = new IOChannel.IOReadableWritableByteChannel(self);↵ | 2 | channel = new IOChannel.IOWritableByteChannel(self);↵ | |
3 | } else {↵ | 3 | } else {↵ | |
4 | channel = new IOChannel.IOReadableByteChannel(self);↵ | 4 | throw context.getRuntime().newTypeError("object does not respond to any of read, write, or <<");↵ | |
5 | } | 5 |
| |
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
Number of mapped statements | 2 |
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.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (self.respondsTo("write") || self.respondsTo("<<")) | 6 | if (self.respondsTo("write") || self.respondsTo("<<")) | |||||||||||
4 | channel = new IOChannel.IOReadableWritableByteChannel(self); |
| 7 | channel = new IOChannel.IOWritableByteChannel(self); | ||||||||||
else | | |||||||||||||
5 | channel = new IOChannel.IOReadableByteChannel(self); |
| | |||||||||||
|
| 8 | throw context.getRuntime().newTypeError("object does not respond to any of read, write, or <<"); |
Row | Violation |
---|---|
1 | Unmatched statement channel=new IOChannel.IOReadableByteChannel(self); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched throw context.getRuntime().newTypeError("object does not respond to any of read, write, or <<"); |