From fd0b19efafcd146f96aa98fbb2c996b6e2ca9e98 Mon Sep 17 00:00:00 2001 From: Vlad Dumitrescu Date: Wed, 10 Sep 2014 12:58:44 +0200 Subject: 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. --- .../java_src/com/ericsson/otp/erlang/AbstractConnection.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/jinterface/java_src/com') 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 -- cgit v1.2.3