diff options
author | Tian Lee <TianL@amdocs.com> | 2018-07-09 09:08:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-09 09:08:59 +0000 |
commit | 388d7128adc5b3dc7fcab73734082f4f2ab5029b (patch) | |
tree | 197ce163b02b26a08072e75cef1ca85d2d1007ea | |
parent | 4b09e9e4fe77a4aa749f1a7ffa07545b64d3e2cb (diff) | |
parent | 0acdb1471fc36039a721f6d1a66b55859ec922de (diff) |
Merge "Fix sonar violations"
-rw-r--r-- | src/main/java/org/onap/crud/event/GraphEvent.java | 23 | ||||
-rw-r--r-- | src/main/java/org/onap/crud/service/AaiResourceService.java | 6 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/main/java/org/onap/crud/event/GraphEvent.java b/src/main/java/org/onap/crud/event/GraphEvent.java index 958c227..b189373 100644 --- a/src/main/java/org/onap/crud/event/GraphEvent.java +++ b/src/main/java/org/onap/crud/event/GraphEvent.java @@ -172,11 +172,28 @@ public class GraphEvent { public String toString() { return toJson(); } - + + @Override + public boolean equals(Object o){ + if(o == this){ + return true; + } + + if( !(o instanceof GraphEvent)){ + return false; + } + + GraphEvent graphEvent = (GraphEvent) o; + return this.dbTransactionId.equals( + graphEvent.getDbTransactionId()) + && this.timestamp == graphEvent.getTimestamp() + && this.operation.equals(graphEvent.getOperation() + ); + } + @Override public int hashCode() { - return Objects.hash(this.dbTransactionId, this.timestamp, this.edge, this.vertex, this.operation, - this.result); + return Objects.hash(this.dbTransactionId, this.timestamp, this.operation); } public String getObjectKey() { diff --git a/src/main/java/org/onap/crud/service/AaiResourceService.java b/src/main/java/org/onap/crud/service/AaiResourceService.java index c0375b4..881f9fd 100644 --- a/src/main/java/org/onap/crud/service/AaiResourceService.java +++ b/src/main/java/org/onap/crud/service/AaiResourceService.java @@ -22,6 +22,7 @@ package org.onap.crud.service; import java.security.cert.X509Certificate;
import java.util.AbstractMap;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
@@ -506,7 +507,7 @@ public class AaiResourceService { authUser = subjectDn.toString();
}
- return this.auth.validateRequest(authUser.toLowerCase(), action.toString() + ":" + authPolicyFunctionName);
+ return this.auth.validateRequest(authUser!=null ? authUser.toLowerCase():"", action.toString() + ":" + authPolicyFunctionName);
} catch (Exception e) {
logResult(action, uri, e);
@@ -518,8 +519,7 @@ public class AaiResourceService { logger.error(CrudServiceMsgs.EXCEPTION_DURING_METHOD_CALL,
op.toString(),
- uri,
- e.getStackTrace().toString());
+ uri, Arrays.toString(e.getStackTrace()));
// Clear the MDC context so that no other transaction inadvertently
// uses our transaction id.
|