Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Resolved
-
None
-
None
-
None
Description
When realname is null, SimplePrincipalCollection throws IllegalArgumentException:
public void add(Object principal, String realmName) { if (realmName == null) { throw new IllegalArgumentException("realmName argument cannot be null."); } if (principal == null) { throw new IllegalArgumentException("principal argument cannot be null."); } this.cachedToString = null; getPrincipalsLazy(realmName).add(principal); }
For the same problem, SimplePrincipalMap throws NullPointerException:
public Object setRealmPrincipal(String realmName, String principalName, Object principal) { if (realmName == null) { throw new NullPointerException("realmName argument cannot be null."); } ...}
IllegalArgumentException seems to be more reasonable, and my code currently catches IllegalArgumentException for this type of the problem. Can the SimplePrincipalMap be modified to throw IllegalArgumentException?
Attachments
Issue Links
- links to