You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacopo Cappellato <ja...@hotwaxmedia.com> on 2013/03/20 10:57:30 UTC

Re: svn commit: r1458429 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Hi David,

is it ok if I backport this also to the 12.04 branch?

Jacopo

On Mar 19, 2013, at 6:48 PM, jonesde@apache.org wrote:

> Author: jonesde
> Date: Tue Mar 19 17:48:28 2013
> New Revision: 1458429
> 
> URL: http://svn.apache.org/r1458429
> Log:
> Fixed issue with deserialization from XML of an entity value with null fields
> 
> Modified:
>    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
> 
> Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1458429&r1=1458428&r2=1458429&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
> +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Tue Mar 19 17:48:28 2013
> @@ -2377,7 +2377,13 @@ public class GenericDelegator implements
>             String attr = element.getAttribute(name);
> 
>             if (UtilValidate.isNotEmpty(attr)) {
> -                value.setString(name, attr);
> +                // GenericEntity.makeXmlElement() sets null values to GenericEntity.NULL_FIELD.toString(), so look for
> +                //     that and treat it as null
> +                if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
> +                    value.set(name, null);
> +                } else {
> +                    value.setString(name, attr);
> +                }
>             } else {
>                 // if no attribute try a subelement
>                 Element subElement = UtilXml.firstChildElement(element, name);
> 
> 


Re: svn commit: r1458429 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
I have backported the rev (with rev 1460317) but I agree it would be great to consider if all the commits done by Jacques in OFBIZ-4602 were really necessary...

Jacopo

On Mar 22, 2013, at 11:05 PM, Jacques Le Roux <ja...@les7arts.com> wrote:

> If it solves all related issues, notably the one with Entity Sync at the origin of the Jira IIRW, then it should be applied to R11.04 and R10.04 as well.
> 
> Else, I believe we should revert all what was committed (and not reverted) in OFBIZ-4602 and tackle the issues at the root again
> 
> Jacques
> 
> From: "David E. Jones" <de...@me.com>
>> 
>> It could be. Wow. That issue is a mess. If it is related it looks like this bug was caused by the "fix" for that issue.
>> 
>> -David
>> 
>> 
>> On Mar 21, 2013, at 4:56 PM, Paul Foxworthy <pa...@cohsoft.com.au> wrote:
>> 
>>> Hi David and Jacopo,
>>> 
>>> is this change related to Jira issue OFBIZ-4602?
>>> 
>>> Thanks
>>> 
>>> Paul Foxworthy
>>> 
>>> 
>>> Jacopo Cappellato-4 wrote
>>>> Hi David,
>>>> 
>>>> is it ok if I backport this also to the 12.04 branch?
>>>> 
>>>> Jacopo
>>>> 
>>>> On Mar 19, 2013, at 6:48 PM, 
>>> 
>>>> jonesde@
>>> 
>>>> wrote:
>>>> 
>>>>> Author: jonesde
>>>>> Date: Tue Mar 19 17:48:28 2013
>>>>> New Revision: 1458429
>>>>> 
>>>>> URL: http://svn.apache.org/r1458429
>>>>> Log:
>>>>> Fixed issue with deserialization from XML of an entity value with null
>>>>> fields
>>>>> 
>>>>> Modified:
>>>>> 
>>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>>> 
>>>>> Modified:
>>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>>> URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1458429&r1=1458428&r2=1458429&view=diff
>>>>> ==============================================================================
>>>>> ---
>>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>>> (original)
>>>>> +++
>>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>>> Tue Mar 19 17:48:28 2013
>>>>> @@ -2377,7 +2377,13 @@ public class GenericDelegator implements
>>>>>           String attr = element.getAttribute(name);
>>>>> 
>>>>>           if (UtilValidate.isNotEmpty(attr)) {
>>>>> -                value.setString(name, attr);
>>>>> +                // GenericEntity.makeXmlElement() sets null values to
>>>>> GenericEntity.NULL_FIELD.toString(), so look for
>>>>> +                //     that and treat it as null
>>>>> +                if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
>>>>> +                    value.set(name, null);
>>>>> +                } else {
>>>>> +                    value.setString(name, attr);
>>>>> +                }
>>>>>           } else {
>>>>>               // if no attribute try a subelement
>>>>>               Element subElement = UtilXml.firstChildElement(element,
>>>>> name);
>>>>> 
>>>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----
>>> --
>>> Coherent Software Australia Pty Ltd
>>> http://www.coherentsoftware.com.au/
>>> 
>>> Bonsai ERP, the all-inclusive ERP system
>>> http://www.bonsaierp.com.au/
>>> 
>>> --
>>> View this message in context: http://ofbiz.135035.n4.nabble.com/Re-svn-commit-r1458429-ofbiz-trunk-framework-entity-src-org-ofbiz-entity-GenericDelegator-java-tp4639948p4639969.html
>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>> 
>> 


Re: svn commit: r1458429 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
If it solves all related issues, notably the one with Entity Sync at the origin of the Jira IIRW, then it should be applied to R11.04 and R10.04 as well.

Else, I believe we should revert all what was committed (and not reverted) in OFBIZ-4602 and tackle the issues at the root again

Jacques

From: "David E. Jones" <de...@me.com>
> 
> It could be. Wow. That issue is a mess. If it is related it looks like this bug was caused by the "fix" for that issue.
> 
> -David
> 
> 
> On Mar 21, 2013, at 4:56 PM, Paul Foxworthy <pa...@cohsoft.com.au> wrote:
> 
>> Hi David and Jacopo,
>> 
>> is this change related to Jira issue OFBIZ-4602?
>> 
>> Thanks
>> 
>> Paul Foxworthy
>> 
>> 
>> Jacopo Cappellato-4 wrote
>>> Hi David,
>>> 
>>> is it ok if I backport this also to the 12.04 branch?
>>> 
>>> Jacopo
>>> 
>>> On Mar 19, 2013, at 6:48 PM, 
>> 
>>> jonesde@
>> 
>>> wrote:
>>> 
>>>> Author: jonesde
>>>> Date: Tue Mar 19 17:48:28 2013
>>>> New Revision: 1458429
>>>> 
>>>> URL: http://svn.apache.org/r1458429
>>>> Log:
>>>> Fixed issue with deserialization from XML of an entity value with null
>>>> fields
>>>> 
>>>> Modified:
>>>> 
>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>> 
>>>> Modified:
>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1458429&r1=1458428&r2=1458429&view=diff
>>>> ==============================================================================
>>>> ---
>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>> Tue Mar 19 17:48:28 2013
>>>> @@ -2377,7 +2377,13 @@ public class GenericDelegator implements
>>>>            String attr = element.getAttribute(name);
>>>> 
>>>>            if (UtilValidate.isNotEmpty(attr)) {
>>>> -                value.setString(name, attr);
>>>> +                // GenericEntity.makeXmlElement() sets null values to
>>>> GenericEntity.NULL_FIELD.toString(), so look for
>>>> +                //     that and treat it as null
>>>> +                if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
>>>> +                    value.set(name, null);
>>>> +                } else {
>>>> +                    value.setString(name, attr);
>>>> +                }
>>>>            } else {
>>>>                // if no attribute try a subelement
>>>>                Element subElement = UtilXml.firstChildElement(element,
>>>> name);
>>>> 
>>>> 
>> 
>> 
>> 
>> 
>> 
>> -----
>> --
>> Coherent Software Australia Pty Ltd
>> http://www.coherentsoftware.com.au/
>> 
>> Bonsai ERP, the all-inclusive ERP system
>> http://www.bonsaierp.com.au/
>> 
>> --
>> View this message in context: http://ofbiz.135035.n4.nabble.com/Re-svn-commit-r1458429-ofbiz-trunk-framework-entity-src-org-ofbiz-entity-GenericDelegator-java-tp4639948p4639969.html
>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
> 
>

Re: svn commit: r1458429 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Posted by "David E. Jones" <de...@me.com>.
It could be. Wow. That issue is a mess. If it is related it looks like this bug was caused by the "fix" for that issue.

-David


On Mar 21, 2013, at 4:56 PM, Paul Foxworthy <pa...@cohsoft.com.au> wrote:

> Hi David and Jacopo,
> 
> is this change related to Jira issue OFBIZ-4602?
> 
> Thanks
> 
> Paul Foxworthy
> 
> 
> Jacopo Cappellato-4 wrote
>> Hi David,
>> 
>> is it ok if I backport this also to the 12.04 branch?
>> 
>> Jacopo
>> 
>> On Mar 19, 2013, at 6:48 PM, 
> 
>> jonesde@
> 
>> wrote:
>> 
>>> Author: jonesde
>>> Date: Tue Mar 19 17:48:28 2013
>>> New Revision: 1458429
>>> 
>>> URL: http://svn.apache.org/r1458429
>>> Log:
>>> Fixed issue with deserialization from XML of an entity value with null
>>> fields
>>> 
>>> Modified:
>>> 
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>> 
>>> Modified:
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1458429&r1=1458428&r2=1458429&view=diff
>>> ==============================================================================
>>> ---
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>> (original)
>>> +++
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>> Tue Mar 19 17:48:28 2013
>>> @@ -2377,7 +2377,13 @@ public class GenericDelegator implements
>>>            String attr = element.getAttribute(name);
>>> 
>>>            if (UtilValidate.isNotEmpty(attr)) {
>>> -                value.setString(name, attr);
>>> +                // GenericEntity.makeXmlElement() sets null values to
>>> GenericEntity.NULL_FIELD.toString(), so look for
>>> +                //     that and treat it as null
>>> +                if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
>>> +                    value.set(name, null);
>>> +                } else {
>>> +                    value.setString(name, attr);
>>> +                }
>>>            } else {
>>>                // if no attribute try a subelement
>>>                Element subElement = UtilXml.firstChildElement(element,
>>> name);
>>> 
>>> 
> 
> 
> 
> 
> 
> -----
> --
> Coherent Software Australia Pty Ltd
> http://www.coherentsoftware.com.au/
> 
> Bonsai ERP, the all-inclusive ERP system
> http://www.bonsaierp.com.au/
> 
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Re-svn-commit-r1458429-ofbiz-trunk-framework-entity-src-org-ofbiz-entity-GenericDelegator-java-tp4639948p4639969.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: svn commit: r1458429 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Posted by Paul Foxworthy <pa...@cohsoft.com.au>.
Hi David and Jacopo,

is this change related to Jira issue OFBIZ-4602?

Thanks

Paul Foxworthy


Jacopo Cappellato-4 wrote
> Hi David,
> 
> is it ok if I backport this also to the 12.04 branch?
> 
> Jacopo
> 
> On Mar 19, 2013, at 6:48 PM, 

> jonesde@

>  wrote:
> 
>> Author: jonesde
>> Date: Tue Mar 19 17:48:28 2013
>> New Revision: 1458429
>> 
>> URL: http://svn.apache.org/r1458429
>> Log:
>> Fixed issue with deserialization from XML of an entity value with null
>> fields
>> 
>> Modified:
>>   
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> 
>> Modified:
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1458429&r1=1458428&r2=1458429&view=diff
>> ==============================================================================
>> ---
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> (original)
>> +++
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> Tue Mar 19 17:48:28 2013
>> @@ -2377,7 +2377,13 @@ public class GenericDelegator implements
>>             String attr = element.getAttribute(name);
>> 
>>             if (UtilValidate.isNotEmpty(attr)) {
>> -                value.setString(name, attr);
>> +                // GenericEntity.makeXmlElement() sets null values to
>> GenericEntity.NULL_FIELD.toString(), so look for
>> +                //     that and treat it as null
>> +                if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
>> +                    value.set(name, null);
>> +                } else {
>> +                    value.setString(name, attr);
>> +                }
>>             } else {
>>                 // if no attribute try a subelement
>>                 Element subElement = UtilXml.firstChildElement(element,
>> name);
>> 
>>





-----
--
Coherent Software Australia Pty Ltd
http://www.coherentsoftware.com.au/

Bonsai ERP, the all-inclusive ERP system
http://www.bonsaierp.com.au/

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Re-svn-commit-r1458429-ofbiz-trunk-framework-entity-src-org-ofbiz-entity-GenericDelegator-java-tp4639948p4639969.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: svn commit: r1458429 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java

Posted by "David E. Jones" <de...@me.com>.
Sorry, just noticed this. Yes, it probably applies to 12.04 as well.

-David


On Mar 20, 2013, at 2:57 AM, Jacopo Cappellato <ja...@hotwaxmedia.com> wrote:

> Hi David,
> 
> is it ok if I backport this also to the 12.04 branch?
> 
> Jacopo
> 
> On Mar 19, 2013, at 6:48 PM, jonesde@apache.org wrote:
> 
>> Author: jonesde
>> Date: Tue Mar 19 17:48:28 2013
>> New Revision: 1458429
>> 
>> URL: http://svn.apache.org/r1458429
>> Log:
>> Fixed issue with deserialization from XML of an entity value with null fields
>> 
>> Modified:
>>   ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> 
>> Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1458429&r1=1458428&r2=1458429&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
>> +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Tue Mar 19 17:48:28 2013
>> @@ -2377,7 +2377,13 @@ public class GenericDelegator implements
>>            String attr = element.getAttribute(name);
>> 
>>            if (UtilValidate.isNotEmpty(attr)) {
>> -                value.setString(name, attr);
>> +                // GenericEntity.makeXmlElement() sets null values to GenericEntity.NULL_FIELD.toString(), so look for
>> +                //     that and treat it as null
>> +                if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
>> +                    value.set(name, null);
>> +                } else {
>> +                    value.setString(name, attr);
>> +                }
>>            } else {
>>                // if no attribute try a subelement
>>                Element subElement = UtilXml.firstChildElement(element, name);
>> 
>> 
>