Skip to content

Commit 3954d65

Browse files
committed
code review fixes
1 parent 3b0ace5 commit 3954d65

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/matlabcontrol/MatlabProxyFactoryOptions.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class MatlabProxyFactoryOptions {
3333
private final String _licenseFile;
3434
private final boolean _useSingleCompThread;
3535
private final int _port;
36-
private final Writer _inputWriter;
36+
private final Writer _outputWriter;
3737
private final Writer _errorWriter;
3838

3939
private MatlabProxyFactoryOptions(Builder options) {
@@ -49,7 +49,7 @@ private MatlabProxyFactoryOptions(Builder options) {
4949
_licenseFile = options._licenseFile;
5050
_useSingleCompThread = options._useSingleCompThread;
5151
_port = options._port;
52-
_inputWriter = options._inputWriter;
52+
_outputWriter = options._outputWriter;
5353
_errorWriter = options._errorWriter;
5454
}
5555

@@ -101,8 +101,8 @@ int getPort() {
101101
return _port;
102102
}
103103

104-
Writer getInputWriter() {
105-
return _inputWriter;
104+
Writer getOutputWriter() {
105+
return _outputWriter;
106106
}
107107

108108
Writer getErrorWriter() {
@@ -140,8 +140,8 @@ public static class Builder {
140140
private volatile String _licenseFile = null;
141141
private volatile boolean _useSingleCompThread = false;
142142
private volatile int _port = 2100;
143-
private volatile Writer _inputWriter;
144-
private volatile Writer _errorWriter;
143+
private volatile Writer _outputWriter = null;
144+
private volatile Writer _errorWriter = null;
145145

146146
//Assigning to a long is not atomic, so use an AtomicLong so that a thread always sees an intended value
147147
private final AtomicLong _proxyTimeout = new AtomicLong(180000L);
@@ -403,13 +403,13 @@ public final Builder setPort(int port) {
403403
}
404404

405405
/**
406-
* Sets the input writer where the standard output of the created matlab process is written to.
406+
* Sets the output writer where the standard output of the created matlab process is written to.
407407
* This is only used when an actual process is spawned for the matlab proxy instance.
408408
*
409-
* @param inputWriter
409+
* @param outputWriter
410410
*/
411-
public final Builder setInputWriter(Writer inputWriter) {
412-
_inputWriter = inputWriter;
411+
public final Builder setOutputWriter(Writer outputWriter) {
412+
_outputWriter = outputWriter;
413413

414414
return this;
415415
}
@@ -418,7 +418,7 @@ public final Builder setInputWriter(Writer inputWriter) {
418418
* Sets the error writer where the error output of the created matlab process is written to.
419419
* This is only used when an actual process is spawned for the matlab proxy instance.
420420
*
421-
* @param inputWriter
421+
* @param errorWriter
422422
*/
423423
public final Builder setErrorWriter(Writer errorWriter) {
424424
_errorWriter = errorWriter;

src/matlabcontrol/RemoteMatlabProxyFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private Process createProcess(RemoteRequestReceiver receiver) throws MatlabConne
274274

275275
//If running under UNIX and MATLAB is hidden these streams need to be read so that MATLAB does not block
276276
if (_options.getHidden() && !Configuration.isWindows()) {
277-
new ProcessStreamDrainer(process.getInputStream(), "Input", _options.getInputWriter()).start();
277+
new ProcessStreamDrainer(process.getInputStream(), "Output", _options.getOutputWriter()).start();
278278
new ProcessStreamDrainer(process.getErrorStream(), "Error", _options.getErrorWriter()).start();
279279
}
280280

0 commit comments

Comments
 (0)