summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDriptaroop Das <driptaroop.das@in.ibm.com>2019-04-11 22:49:16 +0530
committerDriptaroop Das <driptaroop.das@in.ibm.com>2019-04-11 22:49:26 +0530
commita001527b87077c2a2805b498908643fea16d7d3c (patch)
tree4afcf3f125fcf6f2c6cb66e2f07de9d0dc9ac2d3
parent4ac37bffd664bbc2d6d419d9420393193573320d (diff)
LastNotified.java - sonar fixes
LastNotified.java - sonar fixes Issue-ID: AAF-807 Change-Id: I52e2ccc446cbe594fde217ce2b272a0b86e41afd Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java
index d05f38c5..0120ba40 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java
@@ -4,7 +4,7 @@
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
* ===========================================================================
- * Modifications Copyright (C) 2018 IBM.
+ * Modifications 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.
@@ -84,21 +84,16 @@ public class LastNotified {
*
* @param user
* @param target
- * @param target_key
+ * @param targetkey
* @return
*/
- public Date lastNotified(String user, String target, String target_key) {
- String key = user + '|' + target + '|' + target_key;
+ public Date lastNotified(String user, String target, String targetkey) {
+ String key = user + '|' + target + '|' + targetkey;
return lastNotified(key);
}
public Date lastNotified(String key) {
- Date rv = lastNotified.get(key);
- if(rv==null) {
- rv = never;
- lastNotified.put(key, rv);
- }
- return rv;
+ return lastNotified.computeIfAbsent(key, k -> never);
}
private Date add(ResultSet result, Map<String, Date> lastNotified, MarkDelete md) {
@@ -124,8 +119,8 @@ public class LastNotified {
}
private interface MarkDelete {
- public boolean process(String fullKey, Date last);
- };
+ boolean process(String fullKey, Date last);
+ }
private void startQuery(StringBuilder query) {
query.append(SELECT + " WHERE user in (");