From 0a284e41c135fca61a6ab0b70deecdf2d8c48e68 Mon Sep 17 00:00:00 2001 From: Ronan Keogh Date: Tue, 25 Sep 2018 10:00:52 +0100 Subject: Fix LogfileLoader vulnerabilities Change-Id: I02b0c5907e99aa978def1dd04876d6f8e4095ee3 Signed-off-by: Ronan Keogh Issue-ID: DMAAP-775 --- .../dmaap/datarouter/provisioning/utils/LogfileLoader.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'datarouter-prov') diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java index 110c63de..b6ad8e43 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/LogfileLoader.java @@ -214,7 +214,6 @@ public class LogfileLoader extends Thread { } } catch (Exception e) { logger.warn("PROV0020: Caught exception in LogfileLoader: " + e); - e.printStackTrace(); } } } @@ -275,7 +274,7 @@ public class LogfileLoader extends Thread { } } catch (SQLException e) { System.err.println(e); - e.printStackTrace(); + logger.error(e); } finally { db.release(conn); } @@ -297,7 +296,7 @@ public class LogfileLoader extends Thread { } } catch (SQLException e) { System.err.println(e); - e.printStackTrace(); + logger.error(e); } finally { db.release(conn); } @@ -322,7 +321,7 @@ public class LogfileLoader extends Thread { } } catch (SQLException e) { System.err.println(e); - e.printStackTrace(); + logger.error(e); } finally { db.release(conn); } @@ -376,7 +375,7 @@ public class LogfileLoader extends Thread { logger.debug(String.format("initializeNextid, next ID is %d (%x)", nextid, nextid)); } catch (SQLException e) { System.err.println(e); - e.printStackTrace(); + logger.error(e); } finally { db.release(conn); } @@ -417,19 +416,15 @@ public class LogfileLoader extends Thread { } catch (SQLException e) { logger.warn("PROV8003 Invalid value in record: " + line); logger.debug(e); - e.printStackTrace(); } catch (NumberFormatException e) { logger.warn("PROV8004 Invalid number in record: " + line); logger.debug(e); - e.printStackTrace(); } catch (ParseException e) { logger.warn("PROV8005 Invalid date in record: " + line); logger.debug(e); - e.printStackTrace(); } catch (Exception e) { logger.warn("PROV8006 Invalid pattern in record: " + line); logger.debug(e); - e.printStackTrace(); } total++; } -- cgit 1.2.3-korg