portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r736350 - /portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
Date Wed, 21 Jan 2009 17:43:01 GMT
Author: rwatler
Date: Wed Jan 21 09:43:00 2009
New Revision: 736350

URL: http://svn.apache.org/viewvc?rev=736350&view=rev
Log:
ensure RuntimeException not thrown when default security domains do not exist for test setup/teardown


Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java?rev=736350&r1=736349&r2=736350&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
Wed Jan 21 09:43:00 2009
@@ -1007,13 +1007,21 @@
         
     }
 
-    protected Long getDefaultSecurityDomainId() {
-        if (defaultSecurityDomainId == null){
+    protected Long getDefaultSecurityDomainId()
+    {
+        if (defaultSecurityDomainId == null)
+        {
             SecurityDomain d = getDomainByName(SecurityDomain.DEFAULT_NAME);
-            if (d == null){
-                throw new RuntimeException("The default security domain could not be found!");
+            if (d != null)
+            {
+                // cache real default security domain id
+                defaultSecurityDomainId = d.getDomainId();
+            }
+            else
+            {
+                // return fake id that should not exist
+                return new Long(-1);
             }
-            defaultSecurityDomainId=d.getDomainId();
         }   
         return defaultSecurityDomainId;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message