[jira] Created: (OFBIZ-1933) EntityUtil.filterByCondition() fails for condition with 'IN' operator

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-1933) EntityUtil.filterByCondition() fails for condition with 'IN' operator

Nicolas Malin (Jira)
EntityUtil.filterByCondition() fails for condition with 'IN' operator
---------------------------------------------------------------------

                 Key: OFBIZ-1933
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1933
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: SVN trunk
         Environment: Linux (Ubuntu 8.04), PostgreSQL 8.2
            Reporter: Rajib Khan


EntityUtil.filterByCondition() throws following exception while condition is made using "IN" operator:

Target exception: java.lang.ClassCastException: javolution.util.FastList cannot be cast to java.lang.Comparable

How to reproduce:
1) put following code in file "framework/common/script/org/ofbiz/common/BshServiceTest.bsh"  
2) from webtools run service: "testBsh"

import java.util.List;
import org.ofbiz.base.util.Debug;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityOperator;

GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
List users = delegator.findAll("UserLogin");

List userIds = EntityUtil.getFieldListFromEntityList(users, "userLoginId", true);
Debug.log("*** list of user ids = " + userIds);

////////////  fails here ///////////
List filteredUsers = EntityUtil.filterByCondition(users, EntityCondition.makeCondition("userLoginId", EntityOperator.IN, userIds));
Debug.log("*** total filtered users = " + filteredUsers.size());

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1933) EntityUtil.filterByCondition() fails for condition with 'IN' operator

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625243#action_12625243 ]

Scott Gray commented on OFBIZ-1933:
-----------------------------------

This was fixed a few days ago, are you on the latest revision?

> EntityUtil.filterByCondition() fails for condition with 'IN' operator
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-1933
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1933
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Linux (Ubuntu 8.04), PostgreSQL 8.2
>            Reporter: Rajib Khan
>
> EntityUtil.filterByCondition() throws following exception while condition is made using "IN" operator:
> Target exception: java.lang.ClassCastException: javolution.util.FastList cannot be cast to java.lang.Comparable
> How to reproduce:
> 1) put following code in file "framework/common/script/org/ofbiz/common/BshServiceTest.bsh"  
> 2) from webtools run service: "testBsh"
> import java.util.List;
> import org.ofbiz.base.util.Debug;
> import org.ofbiz.entity.util.EntityUtil;
> import org.ofbiz.entity.GenericDelegator;
> import org.ofbiz.entity.condition.EntityCondition;
> import org.ofbiz.entity.condition.EntityOperator;
> GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
> List users = delegator.findAll("UserLogin");
> List userIds = EntityUtil.getFieldListFromEntityList(users, "userLoginId", true);
> Debug.log("*** list of user ids = " + userIds);
> ////////////  fails here ///////////
> List filteredUsers = EntityUtil.filterByCondition(users, EntityCondition.makeCondition("userLoginId", EntityOperator.IN, userIds));
> Debug.log("*** total filtered users = " + filteredUsers.size());

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1933) EntityUtil.filterByCondition() fails for condition with 'IN' operator

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625249#action_12625249 ]

Rajib Khan commented on OFBIZ-1933:
-----------------------------------

I've tested this on revision 687570

> EntityUtil.filterByCondition() fails for condition with 'IN' operator
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-1933
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1933
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Linux (Ubuntu 8.04), PostgreSQL 8.2
>            Reporter: Rajib Khan
>
> EntityUtil.filterByCondition() throws following exception while condition is made using "IN" operator:
> Target exception: java.lang.ClassCastException: javolution.util.FastList cannot be cast to java.lang.Comparable
> How to reproduce:
> 1) put following code in file "framework/common/script/org/ofbiz/common/BshServiceTest.bsh"  
> 2) from webtools run service: "testBsh"
> import java.util.List;
> import org.ofbiz.base.util.Debug;
> import org.ofbiz.entity.util.EntityUtil;
> import org.ofbiz.entity.GenericDelegator;
> import org.ofbiz.entity.condition.EntityCondition;
> import org.ofbiz.entity.condition.EntityOperator;
> GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
> List users = delegator.findAll("UserLogin");
> List userIds = EntityUtil.getFieldListFromEntityList(users, "userLoginId", true);
> Debug.log("*** list of user ids = " + userIds);
> ////////////  fails here ///////////
> List filteredUsers = EntityUtil.filterByCondition(users, EntityCondition.makeCondition("userLoginId", EntityOperator.IN, userIds));
> Debug.log("*** total filtered users = " + filteredUsers.size());

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1933) EntityUtil.filterByCondition() fails for condition with 'IN' operator

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Scott Gray closed OFBIZ-1933.
-----------------------------

    Resolution: Invalid

Yeah that's too old for the fix, you need to come up to at least r688212

> EntityUtil.filterByCondition() fails for condition with 'IN' operator
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-1933
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1933
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Linux (Ubuntu 8.04), PostgreSQL 8.2
>            Reporter: Rajib Khan
>
> EntityUtil.filterByCondition() throws following exception while condition is made using "IN" operator:
> Target exception: java.lang.ClassCastException: javolution.util.FastList cannot be cast to java.lang.Comparable
> How to reproduce:
> 1) put following code in file "framework/common/script/org/ofbiz/common/BshServiceTest.bsh"  
> 2) from webtools run service: "testBsh"
> import java.util.List;
> import org.ofbiz.base.util.Debug;
> import org.ofbiz.entity.util.EntityUtil;
> import org.ofbiz.entity.GenericDelegator;
> import org.ofbiz.entity.condition.EntityCondition;
> import org.ofbiz.entity.condition.EntityOperator;
> GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
> List users = delegator.findAll("UserLogin");
> List userIds = EntityUtil.getFieldListFromEntityList(users, "userLoginId", true);
> Debug.log("*** list of user ids = " + userIds);
> ////////////  fails here ///////////
> List filteredUsers = EntityUtil.filterByCondition(users, EntityCondition.makeCondition("userLoginId", EntityOperator.IN, userIds));
> Debug.log("*** total filtered users = " + filteredUsers.size());

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