File path: /jruby-1.4.0/src/org/jruby/util/ShellLauncher.java | File path: /jruby-1.4.0/src/org/jruby/util/ShellLauncher.java | |||
Method name: void pumpInerr(Process, Ruby)
|
Method name: void pumpInput(Process, Ruby)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | InputStream childIn = unwrapBufferedStream(child.getErrorStream());↵ | 1 | InputStream childIn = unwrapBufferedStream(child.getInputStream());↵ | |
2 | FileChannel childInChannel = null;↵ | 2 | FileChannel childInChannel = null;↵ | |
3 | if (childIn instanceof FileInputStream) {↵ | 3 | if (childIn instanceof FileInputStream) {↵ | |
4 | childInChannel = ((FileInputStream) childIn).getChannel();↵ | 4 | childInChannel = ((FileInputStream) childIn).getChannel();↵ | |
5 | }↵ | 5 | }↵ | |
6 | OutputStream parentOut = unwrapBufferedStream(runtime.getOut());↵ | 6 | OutputStream parentOut = unwrapBufferedStream(runtime.getOut());↵ | |
7 | FileChannel parentOutChannel = null;↵ | 7 | FileChannel parentOutChannel = null;↵ | |
8 | if (parentOut instanceof FileOutputStream) {↵ | 8 | if (parentOut instanceof FileOutputStream) {↵ | |
9 | parentOutChannel = ((FileOutputStream) parentOut).getChannel();↵ | 9 | parentOutChannel = ((FileOutputStream) parentOut).getChannel();↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (childInChannel != null && parentOutChannel != null) {↵ | 11 | if (childInChannel != null && parentOutChannel != null) {↵ | |
12 | inerrPumper = new ChannelPumper(childInChannel, parentOutChannel, Pumper.Slave.IN, this);↵ | 12 | inputPumper = new ChannelPumper(childInChannel, parentOutChannel, Pumper.Slave.IN, this);↵ | |
13 | } else {↵ | 13 | } else {↵ | |
14 | inerrPumper = new StreamPumper(childIn, parentOut, false, Pumper.Slave.IN, this);↵ | 14 | inputPumper = new StreamPumper(childIn, parentOut, false, Pumper.Slave.IN, this);↵ | |
15 | }↵ | 15 | }↵ | |
16 | inerrPumper.start();↵ | 16 | inputPumper.start();↵ | |
17 | inerr = null;↵ | 17 | input = null;↵ | |
18 | inerrChannel = null; | 18 | inputChannel = null; | |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 64 |
Number of mapped statements | 14 |
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) | 7.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | InputStream childIn = unwrapBufferedStream(child.getErrorStream()); |
| 1 | InputStream childIn = unwrapBufferedStream(child.getInputStream()); | ||||||||||||
2 | FileChannel childInChannel = null; | 2 | FileChannel childInChannel = null; | |||||||||||||
3 | if (childIn instanceof FileInputStream) | 3 | if (childIn instanceof FileInputStream) | |||||||||||||
4 | childInChannel = ((FileInputStream)childIn).getChannel(); | 4 | childInChannel = ((FileInputStream)childIn).getChannel(); | |||||||||||||
5 | OutputStream parentOut = unwrapBufferedStream(runtime.getOut()); | 5 | OutputStream parentOut = unwrapBufferedStream(runtime.getOut()); | |||||||||||||
6 | FileChannel parentOutChannel = null; | 6 | FileChannel parentOutChannel = null; | |||||||||||||
7 | if (parentOut instanceof FileOutputStream) | 7 | if (parentOut instanceof FileOutputStream) | |||||||||||||
8 | parentOutChannel = ((FileOutputStream)parentOut).getChannel(); | 8 | parentOutChannel = ((FileOutputStream)parentOut).getChannel(); | |||||||||||||
9 | if (childInChannel != null && parentOutChannel != null) | 9 | if (childInChannel != null && parentOutChannel != null) | |||||||||||||
10 | inerrPumper = new ChannelPumper(childInChannel, parentOutChannel, Pumper.Slave.IN, this); |
| 10 | inputPumper = new ChannelPumper(childInChannel, parentOutChannel, Pumper.Slave.IN, this); | ||||||||||||
else | else | |||||||||||||||
11 | inerrPumper = new StreamPumper(childIn, parentOut, false, Pumper.Slave.IN, this); |
| 11 | inputPumper = new StreamPumper(childIn, parentOut, false, Pumper.Slave.IN, this); | ||||||||||||
12 | inerrPumper.start(); |
| 12 | inputPumper.start(); | ||||||||||||
13 | inerr = null; |
| 13 | input = null; | ||||||||||||
14 | inerrChannel = null; |
| 14 | inputChannel = null; |
Row | Violation |
---|---|
1 | Expression inerrPumper is a field being modified, and thus it cannot be parameterized |
2 | Expression inputPumper is a field being modified, and thus it cannot be parameterized |
3 | Expression inerrPumper is a field being modified, and thus it cannot be parameterized |
4 | Expression inputPumper is a field being modified, and thus it cannot be parameterized |
5 | Expression inerrPumper cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression inputPumper cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression inerr is a field being modified, and thus it cannot be parameterized |
8 | Expression input is a field being modified, and thus it cannot be parameterized |
9 | Expression inerrChannel is a field being modified, and thus it cannot be parameterized |
10 | Expression inputChannel is a field being modified, and thus it cannot be parameterized |