[pal-cvs 3525] [1259] if throws IllegalArgumentException, tomcat dumps the log(ex.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 10月 30日 (木) 10:15:48 JST


Revision: 1259
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1259
Author:   shinsuke
Date:     2008-10-30 10:15:48 +0900 (Thu, 30 Oct 2008)

Log Message:
-----------
if throws IllegalArgumentException, tomcat dumps the log(ex. using a username as empty). 

Modified Paths:
--------------
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/impl/LdapUserSecurityHandler.java


-------------- next part --------------
Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/impl/LdapUserSecurityHandler.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/impl/LdapUserSecurityHandler.java	2008-10-30 00:27:54 UTC (rev 1258)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/impl/LdapUserSecurityHandler.java	2008-10-30 01:15:48 UTC (rev 1259)
@@ -78,7 +78,7 @@
      */
     public boolean isUserPrincipal(String uid)
     {
-        verifyUid(uid);
+        if (!verifyUid(uid)) { return false; }
         return getUserPrincipal(uid) != null;
     }
 
@@ -87,7 +87,7 @@
      */
     public Principal getUserPrincipal(String uid)
     {
-        verifyUid(uid);
+        if (!verifyUid(uid)) { return null; }
         try
         {
             String dn = ldap.lookupByUid(uid);
@@ -110,10 +110,9 @@
      * @param uid
      *            The uid.
      */
-    private void verifyUid(String uid)
+    private boolean verifyUid(String uid)
     {
-        if (StringUtils.isEmpty(uid)) { throw new IllegalArgumentException(
-                "The uid cannot be null or empty."); }
+        return !StringUtils.isEmpty(uid);
     }
 
     /**


pal-cvs メーリングリストの案内
Back to archive index