diff options
author | Bogumil Zebek <bogumil.zebek@nokia.com> | 2018-07-05 14:15:44 +0200 |
---|---|---|
committer | Bogumil Zebek <bogumil.zebek@nokia.com> | 2018-07-05 14:18:15 +0200 |
commit | 0acdb1471fc36039a721f6d1a66b55859ec922de (patch) | |
tree | ead8d739db4b8d7e0d877bd7cd5b0b2dc0920456 /src/main | |
parent | 68cd3355674d66f8feee3d067960c081581a3911 (diff) |
Fix sonar violations
Change-Id: I0f2b7f58cb2176a017c0adf0bacdea2252d8026b
Issue-ID: AAI-1364
Signed-off-by: Bogumil Zebek <bogumil.zebek@nokia.com>
Diffstat (limited to 'src/main')
-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 afabe7e..63b9e4a 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;
@@ -505,7 +506,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);
@@ -517,8 +518,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.
|