summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src/main
diff options
context:
space:
mode:
authorezhil <ezhrajam@in.ibm.com>2018-12-26 17:06:35 +0530
committerezhil <ezhrajam@in.ibm.com>2018-12-26 17:06:48 +0530
commitb59c81f75fc2ad63cf6e1a79beadc6f7c4250164 (patch)
tree53086bc89441bd03e63d99196171996de2ec27e7 /auth/auth-batch/src/main
parent52c89c9940544c1b2db1dd1e0ce9b22e2fcdca42 (diff)
Fixed major sonar issues in MiscID
Fixed issues in MiscID Issue-ID: AAF-684 Change-Id: Ideb151934fcb1c4abb9afd5b3bf892a590636c83 Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'auth/auth-batch/src/main')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/MiscID.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/MiscID.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/MiscID.java
index 45875a20..e30336fb 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/MiscID.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/MiscID.java
@@ -4,6 +4,8 @@
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
* ===========================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ===========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -47,9 +49,12 @@ public class MiscID {
CREATE_DATE - Date when MiscID was created
LAST_RENEWAL_DATE - Date when MiscID Sponsorship was last renewed
*/
- public String id,sponsor,created,renewal;
+ public String id;
+ public String sponsor;
+ public String created;
+ public String renewal;
- private static final String fieldString = "id,created,sponsor,renewal";
+ private static final String FIELD_STRING = "id,created,sponsor,renewal";
/**
* Load a Row of Strings (from CSV file).
@@ -63,8 +68,10 @@ public class MiscID {
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
- public void set(String row []) throws BatchException {
- if (row.length<4) {throw new BatchException("Row of MiscID_XRef is too short");}
+ public void set(String[] row ) throws BatchException {
+ if (row.length<4) {
+ throw new BatchException("Row of MiscID_XRef is too short");
+ }
id = row[0];
sponsor = row[1];
created = row[2];
@@ -80,15 +87,15 @@ public class MiscID {
public static void load(Trans trans, Session session ) {
- load(trans, session,"SELECT " + fieldString + " FROM authz.miscid;",data);
+ load(trans, session,"SELECT " + FIELD_STRING + " FROM authz.miscid;",data);
}
public static void load(Trans trans, Session session, Map<String,MiscID> map ) {
- load(trans, session,"SELECT " + fieldString + " FROM authz.miscid;",map);
+ load(trans, session,"SELECT " + FIELD_STRING + " FROM authz.miscid;",map);
}
public static void loadOne(Trans trans, Session session, String id ) {
- load(trans, session,"SELECT " + fieldString + " FROM authz.miscid WHERE id ='" + id + "';", data);
+ load(trans, session,"SELECT " + FIELD_STRING + " FROM authz.miscid WHERE id ='" + id + "';", data);
}
public static void load(Trans trans, Session session, String query, Map<String,MiscID> map) {
@@ -141,7 +148,7 @@ public class MiscID {
public StringBuilder insertStmt() throws IllegalArgumentException, IllegalAccessException {
StringBuilder sb = new StringBuilder("INSERT INTO authz.miscid (");
- sb.append(fieldString);
+ sb.append(FIELD_STRING);
sb.append(") VALUES ('");
sb.append(id);
sb.append("','");