EofSensorInputStream is generating NullPointerExceptions in some rare situations. This commit fixes that behaviour for the check methods by dereferencing the instance variable to a final local variable to ensure that if it is not null at the null guard, that it will be not null after that point also to successfully close/abort the stream
In some rare cases, null parameters are sent to ReponseEntityProxy methods, this adds checks on those to ensure that the connections are still released, but the null variable is not dereferenced.
Contributed by Peter Ansell <p_ansell@yahoo.com>
Conflicts:
httpclient5/src/main/java/org/apache/hc/client5/http/impl/sync/ResponseEntityProxy.java
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1760585 13f79535-47bb-0310-9956-ffa450edef68