[jboss-cvs] JBossAS SVN: r90164 - in projects/jboss-man/branches/Branch_2_1: metatype/src/main/java/org/jboss/metatype/api/values and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 12 13:05:28 EDT 2009


Author: ispringer
Date: 2009-06-12 13:05:28 -0400 (Fri, 12 Jun 2009)
New Revision: 90164

Modified:
   projects/jboss-man/branches/Branch_2_1/managed/src/main/java/org/jboss/managed/api/annotation/ManagementProperties.java
   projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/api/values/CompositeValueSupport.java
Log:
improve exception messages; fix javadoc typo

Modified: projects/jboss-man/branches/Branch_2_1/managed/src/main/java/org/jboss/managed/api/annotation/ManagementProperties.java
===================================================================
--- projects/jboss-man/branches/Branch_2_1/managed/src/main/java/org/jboss/managed/api/annotation/ManagementProperties.java	2009-06-12 16:56:23 UTC (rev 90163)
+++ projects/jboss-man/branches/Branch_2_1/managed/src/main/java/org/jboss/managed/api/annotation/ManagementProperties.java	2009-06-12 17:05:28 UTC (rev 90164)
@@ -22,7 +22,7 @@
 package org.jboss.managed.api.annotation;
 
 /**
- * ManagementProperities.
+ * ManagementProperties.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @author Scott.Stark at jboss.org

Modified: projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/api/values/CompositeValueSupport.java
===================================================================
--- projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/api/values/CompositeValueSupport.java	2009-06-12 16:56:23 UTC (rev 90163)
+++ projects/jboss-man/branches/Branch_2_1/metatype/src/main/java/org/jboss/metatype/api/values/CompositeValueSupport.java	2009-06-12 17:05:28 UTC (rev 90164)
@@ -90,12 +90,14 @@
       if (itemValues == null)
          itemValues = new MetaValue[0];
       if (itemNames.length != itemValues.length)
-         throw new IllegalArgumentException("itemNames has size " + itemNames.length + " but itemValues has size " + itemValues.length);
+         throw new IllegalArgumentException("for " + this.metaType + ", itemNames has size " + itemNames.length
+               + ", but itemValues has size " + itemValues.length);
 
       Set<String> compositeNames = metaType.itemSet();
       int compositeNameSize = compositeNames.size();
       if (itemNames.length > compositeNameSize)
-         throw new IllegalArgumentException("itemNames has size " + itemNames.length + " but composite type has size " + compositeNameSize);
+         throw new IllegalArgumentException("for " + this.metaType + ", itemNames has size " + itemNames.length
+               + ", but composite type names has size " + compositeNameSize);
 
       this.metaType = metaType;
       contents = new TreeMap<String, MetaValue>();
@@ -103,14 +105,15 @@
       for (int i = 0; i < itemNames.length; i++)
       {
          if (itemNames[i] == null || itemNames[i].length() == 0)
-            throw new IllegalArgumentException("Item name " + i + " is null or empty");
+            throw new IllegalArgumentException("for " + this.metaType + ", item name " + i + " is null or empty");
          if (contents.get(itemNames[i]) != null)
-            throw new IllegalArgumentException("duplicate item name " + itemNames[i]);
+            throw new IllegalArgumentException("for " + this.metaType + ", duplicate item name: " + itemNames[i]);
          MetaType itemType = metaType.getType(itemNames[i]);
          if (itemType == null)
-            throw new IllegalArgumentException("item name not in composite type: " + itemNames[i]);
+            throw new IllegalArgumentException("for " + this.metaType + ", item name not in composite type: " + itemNames[i]);
          if (itemValues[i] != null && itemType.isValue(itemValues[i]) == false)
-            throw new IllegalArgumentException("item value " + itemValues[i] + " for item name " + itemNames[i] + " is not a " + itemType);
+            throw new IllegalArgumentException("for " + this.metaType + ", item value " + itemValues[i]
+                  + " for item name " + itemNames[i] + " is not a " + itemType);
          contents.put(itemNames[i], itemValues[i]);
       }
       




More information about the jboss-cvs-commits mailing list