portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r1648940 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page: impl/SecurityConstraintsImpl.java psml/SecurityConstraintsImpl.java
Date Thu, 01 Jan 2015 21:02:30 GMT
Author: rwatler
Date: Thu Jan  1 21:02:30 2015
New Revision: 1648940

URL: http://svn.apache.org/r1648940
Log:
Correct exception logging/wrapping in SecurityConstraintsImpl implementations.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java?rev=1648940&r1=1648939&r2=1648940&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsImpl.java
Thu Jan  1 21:02:30 2015
@@ -207,14 +207,27 @@ public class SecurityConstraintsImpl imp
                 // since no other constraints were found
                 if ((getOwner() != null) && !actions.isEmpty())
                 {
-                    String action = (String)actions.get(0);
+                    String action = actions.get(0);
                     throw new SecurityException("SecurityConstraintsImpl.checkConstraints():
Access for " + action + " not permitted, (not owner).");
                 }
             }
         }
+        catch (SecurityException se)
+        {
+            // rethrow expected SecurityExceptions
+            throw se;
+        }
         catch (Exception e)
         {
-            log.error("Security constraints check exception: "+e);
+            // log and wrap other unexpected exceptions
+            if (log.isDebugEnabled())
+            {
+                log.error("Security constraints check exception: "+e, e);
+            }
+            else
+            {
+                log.error("Security constraints check exception: "+e);
+            }
             throw new SecurityException("SecurityConstraintsImpl.checkConstraints(): Exception
detected: "+e);
         }
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java?rev=1648940&r1=1648939&r2=1648940&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/psml/SecurityConstraintsImpl.java
Thu Jan  1 21:02:30 2015
@@ -258,9 +258,22 @@ public class SecurityConstraintsImpl imp
                 }
             }
         }
+        catch (SecurityException se)
+        {
+            // rethrow expected SecurityExceptions
+            throw se;
+        }
         catch (Exception e)
         {
-            log.error("Security constraints check exception: "+e);
+            // log and wrap other unexpected exceptions
+            if (log.isDebugEnabled())
+            {
+                log.error("Security constraints check exception: "+e, e);
+            }
+            else
+            {
+                log.error("Security constraints check exception: "+e);
+            }
             throw new SecurityException("SecurityConstraintsImpl.checkConstraints(): Exception
detected: "+e);
         }
     }



---------------------------------------------------------------------
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