Raconeisteron / sheel-ma3aya

Automatically exported from code.google.com/p/sheel-ma3aya
0 stars 0 forks source link

Sprint2: PS22T01: (Logic: if result list is empty, you should avoid FB navigation (Semaphore sleeps after loop)) #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
================
User story
================
22) As a registered user, I should be able to search for people who want to 
carry luggage according to his preferences (facebook friends, social networks)

================
Task
================
if result list is empty, you should avoid FB navigation (Semaphore sleeps after 
loop)

Original issue reported on code.google.com by passant....@gmail.com on 9 Dec 2011 at 9:07

GoogleCodeExporter commented 8 years ago

Original comment by passant....@gmail.com on 9 Dec 2011 at 9:45

GoogleCodeExporter commented 8 years ago

Original comment by passant....@gmail.com on 12 Dec 2011 at 11:43

GoogleCodeExporter commented 8 years ago
Done

1) ViewSearchResultsActivity: add if statement to check the list size is > 0 in 
the filterOffers method before calling searchUsingFacebook

2) FacebookWebservice + ViewSearchResultsActivity : Add warning to the comments 
of the methods doing the search that the minimum allowed size is 1 and that the 
methods should not be called on empty lists

REASON: I did not add if statements in all methods checking if the list is 
empty, then return because it is extra un necessary computations. If a list is 
empty then it should not be passed to such methods in the first place. (Same 
idea like implicit and explicit casting for compilers before the method or 
inside the method). hence, I added a clear warning in the comments and just 
stopped the calling of the method if the list is empty to save unnecesary 
branching instructions

Original comment by passant....@gmail.com on 13 Dec 2011 at 12:00