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

Scott Gray commented on OFBIZ-5869:
-----------------------------------

Hi Leon,

You are correct that EntityQuery.filterByDate(Timestamp) will not perform date 
filtering when the Timestamp is null.  But none of the code that you changed 
uses that particular method.  The code you changed uses a different code path 
and uses a default Timestamp of now.

EntityQuery.filterByDate(String...) calls EntityQuery.filterByDate(Timestamp, 
String...) which doesn't exhibit the same behavior as the above.  

I see there are some inconsistencies in EntityQuery.filterByDate methods 
though, e.g.
EntityQuery.filterByDate(Date) will throw an NPE if Date is null
EntityQuery.filterByDate(Timestamp) will perform no filtering if Timestamp is 
null
EntityQuery.filterByDate(Timestamp, String...) will default to now if Timestamp 
is null

I'll have to have a think about which behavior makes the most sense.

> correction to changeset r1626462  and r1626463  
> ------------------------------------------------
>
>                 Key: OFBIZ-5869
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5869
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL APPLICATIONS
>    Affects Versions: Release Branch 13.07, Trunk
>            Reporter: Leon
>            Assignee: Jacques Le Roux
>             Fix For: Upcoming Branch, 13.07.02
>
>         Attachments: OFBIZ-5869.patch
>
>
> There's error in this commit. e.g.
> – List<GenericValue> allPCMPs = 
> EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", 
> pcmpFindMap, null, false), true);
> ++ allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "contactFromDate", 
> "contactThruDate", true);
> According to EntityUtil.filterByDate(List, EntityCondition, String, String 
> ,Boolean), it filter nothing if condition parameter (the second) is null.
> see OFBIZ-5261.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to