From 2ade740bd3e74e699de71afe2f085ecafd3d37a2 Mon Sep 17 00:00:00 2001 From: Driptaroop Das Date: Thu, 24 Jan 2019 16:36:09 +0530 Subject: Sonar Fixes - ActionPuntDAO and subclasses Sonar Fixes - ActionPuntDAO and subclasses Issue-ID: AAF-730 Change-Id: I43123a886a390620ebd608bad49828596aac1b1d Signed-off-by: Driptaroop Das --- .../org/onap/aaf/auth/batch/actions/ActionPuntDAO.java | 16 ++-------------- .../java/org/onap/aaf/auth/batch/actions/CredPunt.java | 4 ++-- .../java/org/onap/aaf/auth/batch/actions/URPunt.java | 4 ++-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/ActionPuntDAO.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/ActionPuntDAO.java index 37abbaf4..5d060758 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/ActionPuntDAO.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/ActionPuntDAO.java @@ -34,12 +34,12 @@ public abstract class ActionPuntDAO extends ActionDAO { private int months; protected static final Date now = new Date(); - public ActionPuntDAO(AuthzTrans trans, Cluster cluster, int months, int range, boolean dryRun) throws APIException, IOException { + public ActionPuntDAO(AuthzTrans trans, Cluster cluster, int months, boolean dryRun) throws APIException, IOException { super(trans, cluster,dryRun); this.months = months; } - public ActionPuntDAO(AuthzTrans trans, ActionDAO predecessor, int months, int range) { + public ActionPuntDAO(AuthzTrans trans, ActionDAO predecessor, int months) { super(trans, predecessor); this.months = months; } @@ -49,18 +49,6 @@ public abstract class ActionPuntDAO extends ActionDAO { GregorianCalendar temp = new GregorianCalendar(); temp.setTime(current); temp.add(GregorianCalendar.MONTH, months); - - /* - * This method Randomized date. This is no longer needed. Just add the Punt Months. - temp.add(GregorianCalendar.MONTH, months); - if (range>0) { - int forward = Math.abs(random.nextInt()%range); - if (forward>1) { - temp.add(GregorianCalendar.MONTH, forward); - temp.add(GregorianCalendar.DAY_OF_MONTH, (random.nextInt()%30)-15); - } - } - */ return temp.getTime(); } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/CredPunt.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/CredPunt.java index ef6bb94e..8c3188d1 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/CredPunt.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/CredPunt.java @@ -36,11 +36,11 @@ import com.datastax.driver.core.Cluster; public class CredPunt extends ActionPuntDAO { public CredPunt(AuthzTrans trans, Cluster cluster, int months, int range, boolean dryRun) throws IOException, APIException { - super(trans,cluster,months,range,dryRun); + super(trans,cluster,months, dryRun); } public CredPunt(AuthzTrans trans, ActionDAO adao, int months, int range) throws IOException { - super(trans, adao, months,range); + super(trans, adao, months); } public Result exec(AuthzTrans trans, CredDAO.Data cdd,String text) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/URPunt.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/URPunt.java index 18705fb8..28c7a641 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/URPunt.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/actions/URPunt.java @@ -37,11 +37,11 @@ import com.datastax.driver.core.Cluster; public class URPunt extends ActionPuntDAO { public URPunt(AuthzTrans trans, Cluster cluster, int months, int range, boolean dryRun) throws APIException, IOException { - super(trans,cluster, months, range,dryRun); + super(trans,cluster, months, dryRun); } public URPunt(AuthzTrans trans, ActionDAO adao, int months, int range) { - super(trans, adao, months, range); + super(trans, adao, months); } public Result exec(AuthzTrans trans, UserRole ur, String text) { -- cgit 1.2.3-korg