From d86dd644e1543743cfcbc83b230bd4f2cb2e5d4e Mon Sep 17 00:00:00 2001 From: Instrumental Date: Thu, 29 Mar 2018 19:02:24 -0500 Subject: Clean up Sonar results 1 Issue-ID: AAF-206 Change-Id: If1fced5b528490a52691508fb1e30962dbe28856 Signed-off-by: Instrumental --- auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java | 6 ++++-- .../auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java | 2 +- .../src/main/java/org/onap/aaf/auth/cm/service/CMService.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'auth/auth-certman/src') diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java index 521c5016..00b0b378 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java @@ -115,8 +115,10 @@ public abstract class CA { bytes = new byte[(int)crt.length()]; FileInputStream fis = new FileInputStream(crt); try { - fis.read(bytes); - addTrustedCA(new String(bytes)); + int read = fis.read(bytes); + if(read>0) { + addTrustedCA(new String(bytes)); + } } finally { fis.close(); } diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java index ae4e21aa..0d494acd 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/JscepCA.java @@ -61,7 +61,7 @@ public class JscepCA extends CA { private final static String MS_PROFILE="1"; private final static int MAX_RETRY=3; - public static final long INVALIDATE_TIME = 1000*60*10; // 10 mins + public static final long INVALIDATE_TIME = 1000*60*10L; // 10 mins // package on purpose private Map mxcwi_s; diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java index f6407d90..4ef5472a 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java @@ -643,7 +643,7 @@ public class CMService { || trans.user().equals(sponsor)) { return artiDAO.delete(trans, add, false); } - return null; + return Result.err(Result.ERR_Denied, "%1 is not allowed to delete this item",trans.user()); } public Result deleteArtifact(AuthzTrans trans, List list) { -- cgit 1.2.3-korg