You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Chris Howe (JIRA)" <ji...@apache.org> on 2007/01/21 21:06:29 UTC

[jira] Commented: (OFBIZ-400) Allow ShoppingCartHelper.addToCart to be called from simple-method

    [ https://issues.apache.org/jira/browse/OFBIZ-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466346 ] 

Chris Howe commented on OFBIZ-400:
----------------------------------

Both the spring framework and the Apache Hivemind projects deal with this issue by replacing java.lang.Class.forName(className) with one that checks for primitive types.  

http://fisheye1.cenqua.com/browse/~raw,r=1.47/springframework/spring/src/org/springframework/util/ClassUtils.java
http://hivemind.apache.org/hivemind/apidocs/src-html/org/apache/hivemind/util/ConstructorUtils.html

Since Ofbiz is checking for it's common types in cache anyway and ultimately putting any results from java.lang.Class.forName(className) into the CachedClassLoader.globalClassNameClassMap, why not just go ahead and put those there to begin with.  Especially since we're already putting the wrapper objects into it.

> Allow ShoppingCartHelper.addToCart to be called from simple-method
> ------------------------------------------------------------------
>
>                 Key: OFBIZ-400
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-400
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>            Reporter: Chris Howe
>         Assigned To: David E. Jones
>            Priority: Minor
>         Attachments: CachedClassLoader.patch, CachedClassLoader.patch, CachedClassLoader.patch, ShoppingCartHelper.patch
>
>
> To my knowledge a primitive type double cannot be sent from <call-object-method> in minilang.  So to allow ShoppingCartHelper.addToCart to be usable from minilang there are three possible solutions.
> 1)Change minilang to pass primitive type double (if there is a way to do this already, disregard this issue)
> 2)Change addToCart to accept Double quantity instead of double quantity
> 3)Create additional method that accepts Double quantity and then passes that to the current addToCart with a quantity.doubleValue()

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira