[jboss-cvs] JBossAS SVN: r90715 - branches/Branch_5_x/server/src/main/org/jboss/web.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 30 17:44:42 EDT 2009


Author: ALRubinger
Date: 2009-06-30 17:44:42 -0400 (Tue, 30 Jun 2009)
New Revision: 90715

Modified:
   branches/Branch_5_x/server/src/main/org/jboss/web/WebPermissionMapping.java
Log:
[JBAS-7067] Provide more context when making a new WebResourcePermission fails

Modified: branches/Branch_5_x/server/src/main/org/jboss/web/WebPermissionMapping.java
===================================================================
--- branches/Branch_5_x/server/src/main/org/jboss/web/WebPermissionMapping.java	2009-06-30 21:40:58 UTC (rev 90714)
+++ branches/Branch_5_x/server/src/main/org/jboss/web/WebPermissionMapping.java	2009-06-30 21:44:42 UTC (rev 90715)
@@ -217,8 +217,18 @@
             //JACC 1.1: create !(httpmethods) in unchecked perms
             if(httpMethods != null)
             {
-               WebResourcePermission wrpUnchecked = new WebResourcePermission(info.pattern, 
-                     "!" + getCommaSeparatedString(httpMethods));
+               final String pattern = info.pattern;
+               final String methodsAsString = "!" + getCommaSeparatedString(httpMethods);
+               WebResourcePermission wrpUnchecked = null;
+               try
+               {
+                  wrpUnchecked = new WebResourcePermission(pattern, methodsAsString);
+               }
+               catch (final IllegalArgumentException iae)
+               {
+                  throw new IllegalArgumentException("Could not create resource permission with pattern \"" + pattern
+                        + "\" and methods: " + methodsAsString, iae);
+               }
                pc.addToUncheckedPolicy(wrpUnchecked); 
             }
          }




More information about the jboss-cvs-commits mailing list