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 to_outputstream(ThreadContext, IRubyObject)
|
Method name: IRubyObject to_inputstream(ThreadContext, IRubyObject)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | RubyIO io = (RubyIO)self;↵ | 1 | RubyIO io = (RubyIO)self;↵ | |
2 | Ruby runtime = context.getRuntime();↵ | 2 | Ruby runtime = context.getRuntime();↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | io.getOpenFile().checkWritable(context.getRuntime());↵ | 4 | io.getOpenFile().checkReadable(context.getRuntime());↵ | |
5 | } catch (PipeException pe) {↵ | 5 | } catch (PipeException pe) {↵ | |
6 | throw runtime.newErrnoEPIPEError();↵ | 6 | throw runtime.newErrnoEPIPEError();↵ | |
7 | } catch (IOException ex) {↵ | 7 | } catch (IOException ex) {↵ | |
8 | throw runtime.newIOErrorFromException(ex);↵ | 8 | throw runtime.newIOErrorFromException(ex);↵ | |
9 | } catch (BadDescriptorException ex) {↵ | 9 | } catch (BadDescriptorException ex) {↵ | |
10 | throw runtime.newErrnoEBADFError();↵ | 10 | throw runtime.newErrnoEBADFError();↵ | |
11 | } catch (InvalidValueException e) {↵ | 11 | } catch (InvalidValueException e) {↵ | |
12 | throw runtime.newErrnoEINVALError();↵ | 12 | throw runtime.newErrnoEINVALError();↵ | |
13 | }↵ | 13 | }↵ | |
14 | ↵ | 14 | ↵ | |
15 | return JavaUtil.convertJavaToUsableRubyObject(context.getRuntime(), io.getOutStream()); | 15 | return JavaUtil.convertJavaToUsableRubyObject(context.getRuntime(), io.getInStream()); | |
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 declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyIO io = (RubyIO)self; | 1 | RubyIO io = (RubyIO)self; | |||||||||||||||||
2 | Ruby runtime = context.getRuntime(); | 2 | Ruby runtime = context.getRuntime(); | |||||||||||||||||
3 | try | 3 | try | |||||||||||||||||
4 | io.getOpenFile().checkWritable(context.getRuntime()); |
| 4 | io.getOpenFile().checkReadable(context.getRuntime()); | ||||||||||||||||
5 | return JavaUtil.convertJavaToUsableRubyObject(context.getRuntime(), io.getOutStream()); |
| 5 | return JavaUtil.convertJavaToUsableRubyObject(context.getRuntime(), io.getInStream()); |
Row | Violation |
---|---|
1 | Expression io.getOpenFile().checkWritable(context.getRuntime()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression io.getOpenFile().checkReadable(context.getRuntime()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression io.getOpenFile().checkWritable(context.getRuntime()) is a void method call, and thus it cannot be parameterized |
4 | Expression io.getOpenFile().checkReadable(context.getRuntime()) is a void method call, and thus it cannot be parameterized |
5 | Expression io.getOutStream() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression io.getInStream() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Type java.io.OutputStream of variable io.getOutStream() does not match with type java.io.InputStream of variable io.getInStream() |