diff options
author | Instrumental <jonathan.gathman@att.com> | 2018-07-03 13:21:03 -0500 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2018-07-03 13:21:09 -0500 |
commit | 01c17dafca7527ebd8d43d22babea6e2136fc706 (patch) | |
tree | f61d256677863185889aa58af0ac2e6219508127 | |
parent | f85f0889b3b0e5e9694afab4dd01a4a97a155188 (diff) |
Remove Sonar Blockers
Issue-ID: AAF-386
Change-Id: Ic9f1f17b949fd1192a35bce5eb10481fda0e06ee
Signed-off-by: Instrumental <jonathan.gathman@att.com>
6 files changed, 19 insertions, 15 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/Expiring.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/Expiring.java index d3b80d21..df631fe3 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/Expiring.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/Expiring.java @@ -200,7 +200,7 @@ public class Expiring extends Batch { trans.info().log("### Removed",Future.sizeForDeletion(),"Future and",Approval.sizeForDeletion(),"Approvals"); Future.resetLocalData(); Approval.resetLocalData(); - } catch (Throwable t) { + } catch (Exception t) { t.printStackTrace(); } @@ -233,7 +233,7 @@ public class Expiring extends Batch { trans.info().log("### Removed",Future.sizeForDeletion(),"Future and",Approval.sizeForDeletion(),"Approvals"); Future.resetLocalData(); Approval.resetLocalData(); - } catch (Throwable t) { + } catch (Exception t) { t.printStackTrace(); } @@ -256,7 +256,7 @@ public class Expiring extends Batch { trans.info().log("### Removed",Future.sizeForDeletion(),"Future and",Approval.sizeForDeletion(),"Approvals"); Future.resetLocalData(); Approval.resetLocalData(); - } catch (Throwable t) { + } catch (Exception t) { t.printStackTrace(); } } finally { @@ -348,7 +348,7 @@ public class Expiring extends Batch { trans.info().log("### Removed",Future.sizeForDeletion(),"Future and",Approval.sizeForDeletion(),"Approvals"); Future.resetLocalData(); Approval.resetLocalData(); - } catch (Throwable t) { + } catch (Exception t) { t.printStackTrace(); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java index 24f9f887..8529ce87 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java @@ -1730,7 +1730,7 @@ public class Function { default: } } - } catch (Throwable e) { + } catch (Exception e) { trans.error().log("Exception: ", e.getMessage(), " \n occurred while performing", curr.memo, " from Ticket ", curr.id.toString()); diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java index 1a60f68b..2d5e172d 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java @@ -433,8 +433,10 @@ public class AAFcli { try { AAFSSO aafsso = new AAFSSO(args); + String noexit = aafsso.access().getProperty("no_exit"); try { PropAccess access = aafsso.access(); + if(aafsso.ok()) { Define.set(access); AuthzEnv env = new AuthzEnv(access); @@ -589,21 +591,21 @@ public class AAFcli { } finally { aafsso.close(); StringBuilder err = aafsso.err(); - String noexit = aafsso.access().getProperty("no_exit"); if (err != null) { err.append("to continue..."); System.err.println(err); } - if(noexit==null) { - return; - } - } + if(noexit==null) { + return; + } + + } catch (MessageException e) { System.out.println("MessageException caught"); System.err.println(e.getMessage()); - } catch (Throwable e) { + } catch (Exception e) { e.printStackTrace(System.err); } System.exit(rv); diff --git a/auth/pom.xml b/auth/pom.xml index 4ce7b208..193565d6 100644 --- a/auth/pom.xml +++ b/auth/pom.xml @@ -37,7 +37,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.interfaceVersion>2.1.1-SNAPSHOT</project.interfaceVersion> <!-- >project.jettyVersion>9.3.22.v20171030</project.jettyVersion --> - <project.jettyVersion>9.4.8.v20171121</project.jettyVersion> + <project.jettyVersion>9.4.11.v20180605</project.jettyVersion> <powermock.version>1.5.1</powermock.version> <project.ext_root_dir>/opt/app/osaaf</project.ext_root_dir> <!-- SONAR --> diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java index b19be6cd..18f6e7ba 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java @@ -105,7 +105,7 @@ public class Agent { int exitCode = 0; doExit = true; try { - AAFSSO aafsso; + AAFSSO aafsso=null; PropAccess access; if(args.length>0 && args[0].equals("validate")) { @@ -146,7 +146,9 @@ public class Agent { } if(cmds.size()==0) { - aafsso.setLogDefault(); + if(aafsso!=null) { + aafsso.setLogDefault(); + } // NOTE: CHANGE IN CMDS should be reflected in AAFSSO constructor, to get FQI->aaf-id or not System.out.println("Usage: java -jar <cadi-aaf-*-full.jar> cmd [<tag=value>]*"); System.out.println(" create <FQI> [<machine>]"); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java index 974e5810..5aea719e 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java @@ -85,7 +85,7 @@ public class UsersDump { ps.println("</tomcat-users>"); ps.flush(); - } catch (Throwable t) { + } catch (Exception t) { t.printStackTrace(ps); return false; } |