[jboss-cvs] JBossAS SVN: r87390 - in branches/Branch_5_x: profileservice/src/main/org/jboss/profileservice/management/templates and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 15 16:54:42 EDT 2009


Author: emuckenhuber
Date: 2009-04-15 16:54:42 -0400 (Wed, 15 Apr 2009)
New Revision: 87390

Modified:
   branches/Branch_5_x/messaging/src/main/org/jboss/jms/server/destination/SecurityConfigMapper.java
   branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
Log:
[JBAS-6716] don't create a securityConfig for a empty value

Modified: branches/Branch_5_x/messaging/src/main/org/jboss/jms/server/destination/SecurityConfigMapper.java
===================================================================
--- branches/Branch_5_x/messaging/src/main/org/jboss/jms/server/destination/SecurityConfigMapper.java	2009-04-15 20:42:03 UTC (rev 87389)
+++ branches/Branch_5_x/messaging/src/main/org/jboss/jms/server/destination/SecurityConfigMapper.java	2009-04-15 20:54:42 UTC (rev 87390)
@@ -123,11 +123,14 @@
       {
          MapCompositeValueSupport value = (MapCompositeValueSupport) metaValue;
          CompositeMetaType metaType = value.getMetaType();
+         // Don't create a empty securityConfig
+         if(metaType.itemSet().isEmpty())
+            return null;
+         
          // Create the dom document
          Document d = createDocument();
          // Security
          Element security = d.createElement("security");
-         // Get the roles
          for(String name : metaType.itemSet())
          {
             // Role

Modified: branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
===================================================================
--- branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java	2009-04-15 20:42:03 UTC (rev 87389)
+++ branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java	2009-04-15 20:54:42 UTC (rev 87390)
@@ -217,7 +217,8 @@
             else if(name.equals("SecurityConfig"))
             {
                Element e = unwrapMetaValue((MapCompositeValueSupport) v);
-               attribute = new JmsElementMetaData("SecurityConfig", e);
+               if(e != null)
+                  attribute = new JmsElementMetaData("SecurityConfig", e);
             }
          }
          if(attribute != null)
@@ -307,6 +308,10 @@
       
       MapCompositeValueSupport value = (MapCompositeValueSupport) metaValue;
       CompositeMetaType metaType = value.getMetaType();
+      // Don't create a empty set
+      if(metaType.itemSet().isEmpty())
+         return null;
+      
       // Create the dom document
       Document d = createDocument();
       // Security
@@ -316,6 +321,8 @@
       {
          // Role
          CompositeValue row = (CompositeValue) value.get(name);
+         if(row == null)
+            continue;
          Element role = d.createElement("role");
          role.setAttribute("name", name);
          




More information about the jboss-cvs-commits mailing list