diff options
author | 2020-01-31 15:26:05 +0000 | |
---|---|---|
committer | 2020-01-31 15:26:05 +0000 | |
commit | c345a2309421097ba02de062fcbfccd0c0f3be9d (patch) | |
tree | 955c98361b06e94300b067c9ed801f28e82b8a2e /ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java | |
parent | 2edccd7e8ef958d4891ba6de87a449daeb7593fe (diff) | |
parent | a231d482351c64dc35563821d9531981ba28d4f3 (diff) |
Merge "Fix NullPointerException & other sonar issues"
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java index 04e237ae..86f2d912 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Scheduler.java @@ -59,7 +59,7 @@ public class Scheduler extends TimerTask { public void start() { if (timeInterval > 0) - timer.schedule(this, 0, timeInterval * 1000); + timer.schedule(this, 0, timeInterval * 1000L); } public void stop() { @@ -92,18 +92,18 @@ public class Scheduler extends TimerTask { sendNotifications.send_notification(AppUtils.getSMTPServer(), AppUtils.getSMTPServer(), Globals.getSystemName() , AppUtils.getDirectAccessURL(), timeInterval); - } catch (Exception e) { - Log.write("[SYSTEM ERROR Scheduler.run] Exception: " + e.getMessage()); - //e.printStackTrace(); - } - finally { - - try { - sendNotifications.deInit(); - } catch (SQLException e) { - Log.write("[SYSTEM ERROR Scheduler.run] Could not close connection: " + e.getMessage()); - } - } + } catch (Exception e) { + Log.write("[SYSTEM ERROR Scheduler.run] Exception: " + e.getMessage()); + } finally { + try { + if (sendNotifications != null) { + sendNotifications.deInit(); + } + } catch (SQLException e) { + Log.write("[SYSTEM ERROR Scheduler.run] Could not close connection: " + + e.getMessage()); + } + } } // run } // Scheduler |