[OFBiz] SVN: r5067 - in trunk: applications/order/src/org/ofbiz/order/shoppingcart framework/entity/src/org/ofbiz/entity/model

jonesde at svn.ofbiz.org jonesde at svn.ofbiz.org
Wed Jun 1 12:54:02 EDT 2005


Author: jonesde
Date: 2005-06-01 11:53:55 -0500 (Wed, 01 Jun 2005)
New Revision: 5067

Modified:
   trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
   trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java
Log:
Some error message improvements with IDs or entityNames are null

Modified: trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
===================================================================
--- trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java	2005-06-01 16:52:31 UTC (rev 5066)
+++ trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java	2005-06-01 16:53:55 UTC (rev 5067)
@@ -306,6 +306,8 @@
             } else if (paymentMethodTypeId != null) {
                 lookupFields = UtilMisc.toMap("paymentMethodTypeId", paymentMethodTypeId);
                 entityName = "PaymentMethodType";
+            } else {
+                throw new IllegalArgumentException("Could not create value object because paymentMethodId and paymentMethodTypeId are null");
             }
 
             try {

Modified: trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java
===================================================================
--- trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java	2005-06-01 16:52:31 UTC (rev 5066)
+++ trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java	2005-06-01 16:53:55 UTC (rev 5067)
@@ -430,6 +430,9 @@
      * @return An Entity object describing the specified entity of the specified descriptor file.
      */
     public ModelEntity getModelEntity(String entityName) throws GenericEntityException {
+        if (entityName == null) {
+            throw new IllegalArgumentException("Tried to find entity definition for a null entityName");
+        }
         Map ec = getEntityCache();
         if (ec == null) {
             throw new GenericEntityConfException("ERROR: Unable to load Entity Cache");



More information about the Svn mailing list