shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r738001 - /incubator/jsecurity/trunk/core/src/org/jsecurity/authz/permission/WildcardPermission.java
Date Tue, 27 Jan 2009 04:36:42 GMT
Author: lhazlewood
Date: Tue Jan 27 04:36:42 2009
New Revision: 738001

URL: http://svn.apache.org/viewvc?rev=738001&view=rev
Log:
JSEC-15 - applied patch code w/ minor modification

Modified:
    incubator/jsecurity/trunk/core/src/org/jsecurity/authz/permission/WildcardPermission.java

Modified: incubator/jsecurity/trunk/core/src/org/jsecurity/authz/permission/WildcardPermission.java
URL: http://svn.apache.org/viewvc/incubator/jsecurity/trunk/core/src/org/jsecurity/authz/permission/WildcardPermission.java?rev=738001&r1=738000&r2=738001&view=diff
==============================================================================
--- incubator/jsecurity/trunk/core/src/org/jsecurity/authz/permission/WildcardPermission.java
(original)
+++ incubator/jsecurity/trunk/core/src/org/jsecurity/authz/permission/WildcardPermission.java
Tue Jan 27 04:36:42 2009
@@ -102,6 +102,7 @@
  *
  * @author Jeremy Haile
  * @author Les Hazlewood
+ * @author Dain Sundstrom
  * @since 0.9
  */
 public class WildcardPermission implements Permission, Serializable {
@@ -216,4 +217,28 @@
 
         return true;
     }
+
+    public String toString() {
+        StringBuilder buffer = new StringBuilder();
+        for (Set<String> part : parts) {
+            if (buffer.length() > 0) {
+                buffer.append(":");
+            }
+            buffer.append(part);
+        }
+        return buffer.toString();
+    }
+
+    public boolean equals(Object o) {
+        if (o instanceof WildcardPermission) {
+            WildcardPermission wp = (WildcardPermission) o;
+            return parts.equals(wp.parts);
+        }
+        return false;
+    }
+
+    public int hashCode() {
+        return parts.hashCode();
+    }
+
 }



Mime
View raw message