deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdebussc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1279: equals/hashcode for SimpleSecurityViolation
Date Thu, 06 Jul 2017 17:47:26 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master b4c2ed263 -> 02067752c


DELTASPIKE-1279: equals/hashcode for SimpleSecurityViolation


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/02067752
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/02067752
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/02067752

Branch: refs/heads/master
Commit: 02067752c9d4e32262791b9c210763990063bbf9
Parents: b4c2ed2
Author: Rudy De Busscher <rdebusscher@apache.org>
Authored: Thu Jul 6 17:16:39 2017 +0200
Committer: Rudy De Busscher <rdebusscher@apache.org>
Committed: Thu Jul 6 17:16:39 2017 +0200

----------------------------------------------------------------------
 .../authorization/SimpleSecurityViolation.java  | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/02067752/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/authorization/SimpleSecurityViolation.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/authorization/SimpleSecurityViolation.java
b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/authorization/SimpleSecurityViolation.java
index d8e317f..0d46d8d 100644
--- a/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/authorization/SimpleSecurityViolation.java
+++ b/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/authorization/SimpleSecurityViolation.java
@@ -37,4 +37,27 @@ class SimpleSecurityViolation implements SecurityViolation
     {
         return reason;
     }
+
+    @Override
+    public boolean equals(Object o)
+    {
+        if (this == o)
+        {
+            return true;
+        }
+        if (!(o instanceof SimpleSecurityViolation))
+        {
+            return false;
+        }
+
+        SimpleSecurityViolation that = (SimpleSecurityViolation) o;
+
+        return reason != null ? reason.equals(that.reason) : that.reason == null;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return reason != null ? reason.hashCode() : 0;
+    }
 }


Mime
View raw message