Author: markt
Date: Wed May  6 10:26:44 2009
New Revision: 772133

URL: http://svn.apache.org/viewvc?rev=772133&view=rev
Log:
Remove some unnecessary code

Modified:
    tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java

Modified: tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java?rev=772133&r1=772132&r2=772133&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java Wed May  6 
10:26:44 2009
@@ -277,29 +277,19 @@
         
        Connection dbConnection = null;
 
-        try {
-
-            // Ensure that we have an open database connection
-            dbConnection = open();
-            if (dbConnection == null) {
-                // If the db connection open fails, return "not authenticated"
-                return null;
-            }
-            
-            // Acquire a Principal object for this user
-            return authenticate(dbConnection, username, credentials);
-            
-        } catch (SQLException e) {
-            // Log the problem for posterity
-            containerLog.error(sm.getString("dataSourceRealm.exception"), e);
-
-            // Return "not authenticated" for this request
-            return (null);
-
-        } finally {
-               close(dbConnection);
+        // Ensure that we have an open database connection
+        dbConnection = open();
+        if (dbConnection == null) {
+            // If the db connection open fails, return "not authenticated"
+            return null;
         }
+        
+        // Acquire a Principal object for this user
+        Principal principal = authenticate(dbConnection, username, 
credentials);
+            
+       close(dbConnection);
 
+       return principal;
     }
 
 
@@ -320,7 +310,7 @@
      */
     protected Principal authenticate(Connection dbConnection,
                                                String username,
-                                               String credentials) throws 
SQLException{
+                                               String credentials) {
 
         String dbCredentials = getPassword(dbConnection, username);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to