Sonar critical issues 95/43295/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 17 Apr 2018 09:37:25 +0000 (15:07 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Tue, 17 Apr 2018 09:37:25 +0000 (15:07 +0530)
 Either log or rethrow this exception
Sonar Link:
https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-Vah332hFUzlqc5uo&resolved=false&severities=CRITICAL
Location:
src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java
Line No-132

Change-Id: I124eefbc7834d6eb3d02ceda34425967506227f4
Issue-ID: DMAAP-419
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
src/main/java/com/att/nsa/cambria/resources/streamReaders/CambriaTextStreamReader.java

index 2b76a61..41b9275 100644 (file)
@@ -25,6 +25,7 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.util.logging.Logger;
 
 import javax.servlet.http.HttpServletResponse;
 
@@ -33,6 +34,8 @@ import com.att.nsa.cambria.backends.Publisher.message;
 import com.att.nsa.cambria.beans.LogDetails;
 import com.att.nsa.cambria.resources.CambriaEventSet.reader;
 
+import jline.internal.Log;
+
 /**
  * This stream reader just pulls single lines. It uses the default partition if provided. If
  * not, the key is the current time, which does not guarantee ordering.
@@ -42,6 +45,7 @@ import com.att.nsa.cambria.resources.CambriaEventSet.reader;
  */
 public class CambriaTextStreamReader implements reader
 {
+       private Logger log = Logger.getLogger(CambriaTextStreamReader.class.toString());
        /**
         * This is the constructor for Cambria Text Reader format
         * @param is
@@ -131,6 +135,7 @@ public class CambriaTextStreamReader implements reader
                }
                catch ( IOException e )
                {
+                       Log.error(e);
                        throw new CambriaApiException ( HttpServletResponse.SC_BAD_REQUEST, e.getMessage () );
                }
        }