Fix NullPointerException caused by null log object 99/12199/1
authorLee, Tian (tl5884) <tianl@amdocs.com>
Wed, 13 Sep 2017 13:35:18 +0000 (14:35 +0100)
committerLee, Tian (tl5884) <tianl@amdocs.com>
Wed, 13 Sep 2017 13:45:54 +0000 (14:45 +0100)
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) <tianl@amdocs.com>
src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java

index a9fd9bd..012e95e 100644 (file)
@@ -59,6 +59,8 @@ public class MRBaseClient extends HttpClient implements MRClient
        protected MRBaseClient ( Collection<String> hosts ) throws MalformedURLException
        {
                super ( ConnectionType.HTTP, hosts, MRConstants.kStdMRServicePort );
+               
+               fLog = LoggerFactory.getLogger ( this.getClass().getName () );
        }
 
        protected MRBaseClient ( Collection<String> hosts, int stdSvcPort ) throws MalformedURLException {