Re: findOne signatures refactoring

2011-09-28 Thread Martin Kreidenweis
Hi, 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. Let me try to explain from

Re: findOne signatures refactoring

2011-09-28 Thread Jacques Le Roux
Right, it was another (logical) issue in code. I mixed up both when it was actually obvious that a map was rendered by UtilMisc.toMap(field1, value1) hence no issues :/ Thanks for your help (both Scott and you) Jacques From: Martin Kreidenweis martin.kreidenw...@tngtech.com Hi, changing a

findOne signatures refactoring

2011-09-27 Thread Jacques Le Roux
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

Re: findOne signatures refactoring

2011-09-27 Thread Martin Kreidenweis
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

Re: findOne signatures refactoring

2011-09-27 Thread Scott Gray
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

Re: findOne signatures refactoring

2011-09-27 Thread Jacques Le Roux
I had 2 values 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. Let me try to explain