[ 
https://issues.apache.org/jira/browse/OFBIZ-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Morley updated OFBIZ-3599:
------------------------------

    Attachment: OFBIZ-3599_FixBadSerialNumberRetrieval.patch

This fixes the problem Jacques has found in his review -- I had missed the loop 
and thought that it was only using the first serial number; as a result I was 
getting the 0th index in the list.  The code originally had an iterator that I 
got away from using.  The for loop that this is used in is doing it from the 
Oagis feed which reports the quantity and determines the maximum number based 
on what was provided, so we should not get an index violation here as this 
quantity is based on the maximum number of serial numbers that would be in the 
list (that is consistent with what the original code was doing).

As for the cast -- in general I was creating the inputs to adhere to the 
parameter for the delegator.findByPrimaryKey -- in this case it expects a 
Map<String, Object>.  In my mind I would have had to check each parameter to 
ensure it was a String; in reality the compiler would have handled that.  At 
any rate, I generally code it as Map<String, Object> for consistency and 
casting the first String to a Object tricks the compiler into having the 
UtilValidate method return a Map<String, Object>.  In fact, this is our typical 
internal compile error -- in Eclipse it will allow Map<String, Object> x = 
UtilValidate.toMap("a", "b"); but when compiling from the command-line it will 
fail.

At any rate, if we can just correct the one mistake I am think we are good.  :)

> specialpurpose - oagis
> ----------------------
>
>                 Key: OFBIZ-3599
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3599
>             Project: OFBiz
>          Issue Type: Sub-task
>            Reporter: Bob Morley
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-3599_FixBadSerialNumberRetrieval.patch, 
> OFBIZ-3599_ResolveJavaWarningsOagis.patch
>
>


-- 
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

        

Reply via email to