From: Lee, Tian (tl5884) Date: Wed, 13 Sep 2017 13:35:18 +0000 (+0100) Subject: Fix NullPointerException caused by null log object X-Git-Tag: v1.0.0~26 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=6df64160eb361459659d46343342df5d3703077f;p=dmaap%2Fmessagerouter%2Fdmaapclient.git Fix NullPointerException caused by null log object Only two of the three constructors in MRBaseClient class actually initialises the fLog object. When the one that doesn't is invoked, any invokations of the logger in the class and its sub-classes will result in a NullPointerException. Change-Id: I112e932f22679b190dc03d00dc8d7341f8a24aa4 Issue-Id: DMAAP-132 Signed-off-by: Lee, Tian (tl5884) --- diff --git a/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java b/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java index a9fd9bd..012e95e 100644 --- a/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java +++ b/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java @@ -59,6 +59,8 @@ public class MRBaseClient extends HttpClient implements MRClient protected MRBaseClient ( Collection hosts ) throws MalformedURLException { super ( ConnectionType.HTTP, hosts, MRConstants.kStdMRServicePort ); + + fLog = LoggerFactory.getLogger ( this.getClass().getName () ); } protected MRBaseClient ( Collection hosts, int stdSvcPort ) throws MalformedURLException {