You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Mridul Pathak (JIRA)" <ji...@apache.org> on 2009/09/11 11:51:58 UTC

[jira] Created: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

UEL doesn't support variable name modifiers for an object accessed via a key in a Map
-------------------------------------------------------------------------------------

                 Key: OFBIZ-2928
                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: Release Branch 9.04, SVN trunk
            Reporter: Mridul Pathak
             Fix For: Release Branch 9.04, SVN trunk


This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
{code:xml}
<set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
{code}

Gives following warning:
2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.

While it works for context variables like:
{code:xml}
<set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
<set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
<set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
{code}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Mridul Pathak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759126#action_12759126 ] 

Mridul Pathak commented on OFBIZ-2928:
--------------------------------------

Adrian, I tested the patch extensively and it worked well.  I didn't noticed any weird behavior in the logs.  The patch looks in good shape now.

> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum reassigned OFBIZ-2928:
----------------------------------

    Assignee: Adrian Crum

> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum updated OFBIZ-2928:
-------------------------------

    Attachment: OFBiz-2928.patch

Updated patch.

Mridul, could you give it a try please?


> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Mridul Pathak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak updated OFBIZ-2928:
---------------------------------

    Attachment: OFBiz-2928.patch

Here is the patch for the fix.

> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum updated OFBIZ-2928:
-------------------------------

    Attachment: OFBiz-2928.patch

Mridul,

Please try the attached patch and let me know if it fixes the problem. I used your idea, but I eliminated the redundant code.


> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch, OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Mridul Pathak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak updated OFBIZ-2928:
---------------------------------

    Attachment: OFBiz-2928.patch

Adrian,

    I tried your patch, but there are two problems with it:

1) Resolving localized variables through VariableMapper, and resolving property of LocalizedMap are conflicting, in the later case the property of GenericEntity isn't getting resolved as the code is trying to find locale in GenericEntity object even when locale is already resolved in ExtendedMapResolver.getValue() method.

2) The variable name modifier is not working for maps which are not instance of LocalizedMap.

In the attached patch, following the same approach as you did, I have tried to fix above two issues.  Please LMK how does it look.

> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OFBIZ-2928) UEL doesn't support variable name modifiers for an object accessed via a key in a Map

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum closed OFBIZ-2928.
------------------------------

    Resolution: Fixed

Fixed trunk rev 818500, R9.04 rev 818515.

Thanks Mridul!


> UEL doesn't support variable name modifiers for an object accessed via a key in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is not valid for entity [ItemIssuance], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.