From de5f58719eea97ac92085568974b6c87af5e0e55 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Sun, 28 Jul 2019 01:42:50 +0530 Subject: Sonar Fix: ApprovalDAO.java Fixed sonar issues across this file Issue-ID: AAF-912 Change-Id: I030cf2e17e52fa8efe2bc2f003222794e7f9c55a Signed-off-by: Arundathi Patil --- .../org/onap/aaf/auth/dao/cass/ApprovalDAO.java | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'auth/auth-cass/src/main') 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 4c66c964..54f57449 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 @@ -3,6 +3,8 @@ * org.onap.aaf * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * Modification Copyright (c) 2019 IBM * =========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +52,10 @@ public class ApprovalDAO extends CassDAOImpl { private static final String TABLE = "approval"; private static final String TABLELOG = "approved"; private HistoryDAO historyDAO; - private PSInfo psByUser, psByApprover, psByTicket, psByStatus; + private PSInfo psByUser; + private PSInfo psByApprover; + private PSInfo psByTicket; + private PSInfo psByStatus; public ApprovalDAO(AuthzTrans trans, Cluster cluster, String keyspace) { @@ -213,12 +218,18 @@ public class ApprovalDAO extends CassDAOImpl { sb.append(TABLELOG); sb.append(" (id,user,approver,type,status,memo,operation) VALUES ("); sb.append(data.id); - sb.append(",'"); sb.append(data.user); - sb.append("','"); sb.append(data.approver); - sb.append("','"); sb.append(data.type); - sb.append("','"); sb.append(data.status); - sb.append("','"); sb.append(data.memo.replace("'", "''")); - sb.append("','"); sb.append(data.operation); + sb.append(",'"); + sb.append(data.user); + sb.append("','"); + sb.append(data.approver); + sb.append("','"); + sb.append(data.type); + sb.append("','"); + sb.append(data.status); + sb.append("','"); + sb.append(data.memo.replace("'", "''")); + sb.append("','"); + sb.append(data.operation); sb.append("');\n"); sb.append("DELETE FROM "); sb.append(TABLE); -- cgit 1.2.3-korg