/[Apache-SVN]
ViewVC logotype

Revision 1393948


Jump to revision: Previous Next
Author: jleroux
Date: Thu Oct 4 08:07:34 2012 UTC (11 years, 5 months ago)
Changed paths: 1
Log Message:
A patch from Paul Foxworthy "Recalculate Order causes NumberFormatException" https://issues.apache.org/jira/browse/OFBIZ-5046

On demo site, create a new order by using the URL https://demo-trunk.ofbiz.apache.org/ordermgr/control/orderentry

Enter any Product ID, e.g. GZ-1000
Enter a Quantity, e.g. 1
Click on Add To Order

Now click on Recalculate Order on the title bar of the Create Order screenlet
Check the logs. On the demo site, you can do this with the URL https://demo-trunk.ofbiz.apache.org/webtools/control/LogView

You will see:
Exception: java.lang.NumberFormatException Message: For input string: "i18n" ---- stack trace --------------------------------------------------------------- java.lang.NumberFormatException: For input string: "i18n" java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) java.lang.Integer.parseInt(Integer.java:449) java.lang.Integer.parseInt(Integer.java:499) org.ofbiz.order.shoppingcart.ShoppingCartHelper.modifyCart(ShoppingCartHelper.java:673)

The problem is the suffix _i18n on the input elements. The code in modifycart assumes the last thing in the parameter names is a sequence number.
This problem is not as severe as OFBIZ-5045, because the exception is swallowed immediately and the cart is updated properly. Still, these exceptions slow down OFBiz and add noise to the logs.


Changed paths

Path Details
Directoryofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26