No matter how many times I read what you've written below I can't understand 
what issue you ran into?

You had:
delegator.findOne("Entity", true, "field1", value1);
and you tried to change it to:
delegator.findOne("Entity", true, UtilMisc.toMap("field1", value1));
?

That should still work since findOne(String, boolean, Object...) would still be 
used and it calls UtilMisc.toMap(Object...) which supports exactly this 
scenario.  What is the problem?

Regards
Scott

On 27/09/2011, at 8:24 PM, Jacques Le Roux wrote:

> Hi,
> 
> I suggest to refactor findOne signatures. Or actually only the signature 
> w/out ellipsis. When we introduced the signature with elilpsis the cache 
> argument was inevitably in the middle. We kept the signature for the other 
> method. I was caught recently by changing a method call from ellipsis 
> signature to the other. I introduced UtilMisc.toMap for the last argument 
> because I had 2 values and changed for one only, hence ellipsis could not be 
> used. I did that in a hurry, not thinking about the argument swap.
> 
> So it would be only a matter of swapping the cache argument from last place 
> to second in the old signature. IMO it makes sense to have "consistent" 
> signatures... Maybe findOne is not the only one to change...
> 
> Opinions?
> 
> Jacques 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to