From f9901518f13b32233541032667a5ff3aca9e17f8 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Mon, 16 Sep 2019 13:44:41 +0530 Subject: Sonar fix: ApprovalDAO.java Fixed sonar issues across this file Issue-ID: AAF-968 Change-Id: Icca44e89aa28d56e0690a488a68427c2b085f64f Signed-off-by: Arundathi Patil --- .../src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'auth/auth-cass/src/main/java/org') diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java index 7e90bbb9..5583dc03 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java @@ -57,6 +57,7 @@ public class ApprovalDAO extends CassDAOImpl { private PSInfo psByTicket; private PSInfo psByStatus; + private static final int KEYLIMIT = 1; public ApprovalDAO(AuthzTrans trans, Cluster cluster, String keyspace) { super(trans, ApprovalDAO.class.getSimpleName(),cluster,keyspace,Data.class,TABLE, readConsistency(trans,TABLE), writeConsistency(trans,TABLE)); @@ -71,7 +72,6 @@ public class ApprovalDAO extends CassDAOImpl { init(trans); } - private static final int KEYLIMIT = 1; public static class Data { public UUID id; public UUID ticket; @@ -81,7 +81,6 @@ public class ApprovalDAO extends CassDAOImpl { public String status; public String memo; public String operation; -// public Date last_notified; public Date updated; } @@ -102,7 +101,6 @@ public class ApprovalDAO extends CassDAOImpl { data.status = row.getString(5); data.memo = row.getString(6); data.operation = row.getString(7); -// data.last_notified = row.getTimestamp(8); // This is used to get "WRITETIME(STATUS)" from Approval, which gives us an "updated" if (row.getColumnDefinitions().size()>8) { // Rows reported in MicroSeconds @@ -117,8 +115,8 @@ public class ApprovalDAO extends CassDAOImpl { } @Override - protected void body(Data data, int _idx, Object[] obj) { - int idx = _idx; + protected void body(Data data, int idxParam, Object[] obj) { + int idx = idxParam; obj[idx]=data.ticket; obj[++idx]=data.user; obj[++idx]=data.approver; @@ -126,7 +124,6 @@ public class ApprovalDAO extends CassDAOImpl { obj[++idx]=data.status; obj[++idx]=data.memo; obj[++idx]=data.operation; -// obj[++idx]=data.last_notified; } } -- cgit 1.2.3-korg