jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r478672 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
Date Thu, 23 Nov 2006 21:09:39 GMT
Author: jukka
Date: Thu Nov 23 13:09:38 2006
New Revision: 478672

URL: http://svn.apache.org/viewvc?view=rev&rev=478672
Log:
JCR-636: Login should fail if it doesn't succeed.

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java?view=diff&rev=478672&r1=478671&r2=478672
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
Thu Nov 23 13:09:38 2006
@@ -138,18 +138,19 @@
                     Collections.EMPTY_MAP,
                     this.options);
 
+            LoginException failure = null;
             try {
-                if (this.module.login()) {
-                    this.module.commit();
+                if (!module.login()) {
+                    failure = new LoginException("Login not confirmed");
                 }
+            } catch (LoginException e) {
+                failure = e;
             }
-            catch (LoginException le) {
-                try {
-                    this.module.abort();
-                } catch (Exception e) {
-                    // Ignore
-                }
-                throw le;
+            if (failure == null) {
+                module.commit();
+            } else {
+                module.abort();
+                throw failure;
             }
         }
 



Mime
View raw message