From: Henrique P. <hp...@gm...> - 2010-09-03 16:26:03
|
Hi Mike, On Thu, Sep 2, 2010 at 6:40 PM, Mike Schrag <ms...@po...> wrote: > I would say that it's just maintaining the contract of the fetch specification. In fact, it does break the contract and that is the problem. :) If the ERXS.sort method change at least one object from its position, it breaks the contract. The only way to honor the contract is to not reorder the subset of objects returned by the fetch. If the sort method must do nothing to be correct, why execute this code at all? > I don't like removing the code -- that seems wrong and like it could really mess up downstream code in really subtle ways. I would say that if you don't want it sorted, don't pass in a fetch spec with a sort ordering. Well, that is not an option. The sort ordering has a high impact in the set of objects returned by this method. > It seems like we should fix whatever is wrong with the sort, too, though. > Yes, it is an option. But the bug will continue to exist for other unpredictable cases. :) Cheers, Henrique > ms > > On Sep 2, 2010, at 5:28 PM, Henrique Prange wrote: > >> Hi, >> >> I've been using the ERXEOControlUtilities.objectsInRange method and I noticed the objects returned by this method are sorted in memory after the fetch: >> >> NSMutableArray objects = ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(ec, gids, spec.refreshesRefetchedObjects()); (line 609) >> >> ... >> >> ERXS.sort(objects, spec.sortOrderings()); (line 615) >> >> Is there any reason for reordering the fetched objects? >> >> This code is producing wrong results when sorting accented Strings. I would like to know if you see any side effects in removing this piece of code. >> >> Cheers, >> >> Henrique >> ------------------------------------------------------------------------------ >> This SF.net Dev2Dev email is sponsored by: >> >> Show off your parallel programming skills. >> Enter the Intel(R) Threading Challenge 2010. >> http://p.sf.net/sfu/intel-thread-sfd >> _______________________________________________ >> Wonder-disc mailing list >> Won...@li... >> https://lists.sourceforge.net/lists/listinfo/wonder-disc > > |