diff --git a/core/src/main/java/org/acegisecurity/acl/basic/NamedEntityObjectIdentity.java b/core/src/main/java/org/acegisecurity/acl/basic/NamedEntityObjectIdentity.java index b38e265387..edf32a8eed 100644 --- a/core/src/main/java/org/acegisecurity/acl/basic/NamedEntityObjectIdentity.java +++ b/core/src/main/java/org/acegisecurity/acl/basic/NamedEntityObjectIdentity.java @@ -29,9 +29,6 @@ import java.lang.reflect.Method; * instance. Also offers a constructor that uses reflection to build the * identity information. *
- * - * @author Ben Alex - * @version $Id$ */ public class NamedEntityObjectIdentity implements AclObjectIdentity { //~ Instance fields ======================================================== @@ -42,18 +39,16 @@ public class NamedEntityObjectIdentity implements AclObjectIdentity { //~ Constructors =========================================================== public NamedEntityObjectIdentity(String classname, String id) { - if ((classname == null) || "".equals(classname)) { - throw new IllegalArgumentException("classname required"); - } - - if ((id == null) || "".equals(id)) { - throw new IllegalArgumentException("id required"); - } - + Assert.hasText(classname, "classname required"); + Assert.hasText(id, "id required"); this.classname = classname; this.id = id; } + protected NamedEntityObjectIdentity() { + throw new IllegalArgumentException("Cannot use default constructor"); + } + /** * Creates theNamedEntityObjectIdentity based on the passed
* object instance. The passed object must provide a getId()
@@ -83,30 +78,8 @@ public class NamedEntityObjectIdentity implements AclObjectIdentity {
}
}
- protected NamedEntityObjectIdentity() {
- throw new IllegalArgumentException("Cannot use default constructor");
- }
-
//~ Methods ================================================================
- /**
- * Indicates the classname portion of the object identity.
- *
- * @return the classname (never null)
- */
- public String getClassname() {
- return classname;
- }
-
- /**
- * Indicates the instance identity portion of the object identity.
- *
- * @return the instance identity (never null)
- */
- public String getId() {
- return id;
- }
-
/**
* Important so caching operates properly.
*
@@ -138,6 +111,24 @@ public class NamedEntityObjectIdentity implements AclObjectIdentity {
return false;
}
+ /**
+ * Indicates the classname portion of the object identity.
+ *
+ * @return the classname (never null)
+ */
+ public String getClassname() {
+ return classname;
+ }
+
+ /**
+ * Indicates the instance identity portion of the object identity.
+ *
+ * @return the instance identity (never null)
+ */
+ public String getId() {
+ return id;
+ }
+
/**
* Important so caching operates properly.
*