aboutsummaryrefslogtreecommitdiffstats
path: root/lib/jinterface/java_src/com/ericsson/otp
diff options
context:
space:
mode:
authorVlad Dumitrescu <[email protected]>2014-09-10 12:58:44 +0200
committerVlad Dumitrescu <[email protected]>2014-09-11 21:24:29 +0200
commitfd0b19efafcd146f96aa98fbb2c996b6e2ca9e98 (patch)
tree3387e0094497db5a01dff0906bbab6859049e92f /lib/jinterface/java_src/com/ericsson/otp
parent4390e435584d57b5fb41309f80043cb954c241cd (diff)
downloadotp-fd0b19efafcd146f96aa98fbb2c996b6e2ca9e98.tar.gz
otp-fd0b19efafcd146f96aa98fbb2c996b6e2ca9e98.tar.bz2
otp-fd0b19efafcd146f96aa98fbb2c996b6e2ca9e98.zip
fix warning: Socket's InputStream not closed
The warning is issued if we assign the stream to a variable. The stream is getting closed together with the socket.
Diffstat (limited to 'lib/jinterface/java_src/com/ericsson/otp')
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java
index 798cd6c689..b8a973753a 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java
@@ -20,7 +20,6 @@
package com.ericsson.otp.erlang;
import java.io.IOException;
-import java.io.InputStream;
import java.net.Socket;
import java.util.Random;
@@ -918,18 +917,16 @@ public abstract class AbstractConnection extends Thread {
int got = 0;
final int len = b.length;
int i;
- InputStream is = null;
synchronized (this) {
if (s == null) {
throw new IOException("expected " + len
+ " bytes, socket was closed");
}
- is = s.getInputStream();
}
while (got < len) {
- i = is.read(b, got, len - got);
+ i = s.getInputStream().read(b, got, len - got);
if (i < 0) {
throw new IOException("expected " + len