Jawa / Говнокод #5790 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
public static void getShops(Favorite favoriteBrands,
			Favorite favoriteShops, StationItem station,
			WorkingTimeFilter workTimeFilter, boolean[] filter, String keyword,
			GeoLocationPointItem userLocation,
			GeoLocationPointItem searchLocation, String catalogId,
			String netId, String page, String pageSize, String api,
			AsyncTask callback, ConnectionWatcher watcher) {
//...
//упаковка кучи параметров


		boolean emptyFavBrands = false;
		if (favoriteBrands != null) {
			int i = 0;
			for (FavoriteItem item : favoriteBrands) {
				String id = item.getId();
				Log.i(tag, "addFaforiteBrand " + id);
				params.add(new BasicNameValuePair(PARAMS_FAVORITE_BRAND_ID
						+ "[" + i + "]", id));
				i++;
			}
			if (i == 0)
				emptyFavBrands = true;
		}

		boolean emptyFavShops = false;
		if (favoriteShops != null) {
			int i = 0;
			for (FavoriteItem item : favoriteShops) {
				String id = item.getId();
				Log.i(tag, "addFaforiteShop " + id);
				params.add(new BasicNameValuePair(PARAMS_FAVORITE_SHOP_ID + "[" + i
						+ "]", id));
				i++;
			}
			if (i == 0)
				emptyFavShops = true;
		}

		boolean error = false;

		if (emptyFavBrands && emptyFavShops) {
			if (favoriteBrands != null || favoriteShops != null)
				error = true;
		}

		if (emptyFavShops) {
			if (favoriteBrands == null && favoriteShops != null)
				error = true;
		}

		if (emptyFavBrands) {
			if (favoriteBrands != null && favoriteShops == null)
				error = true;
		}

		if (error) {
			callback.onError(JsonEntity.FAVORITE_ERROR, new IOException());
			return;
		}
}

Обращение к веб-сервису. Вызов этого метода при переносе IDE "растекается" на 5-6 строк.
Самое интересное - проверка корректности параметров находится в самом конце метода (длиной 150 строк)

Запостил: rphx rphx, (Updated )

Комментарии (3) RSS

  • [url=http://www.hombresropainterior.com]calvin klein[/url], as well as other businesses that choose to sell [url=http://www.hombresropainterior.com/hombre-calvin-klein-c-15.html]famosas en ropa interior[/url] consumers are not so easy to manipulate. [url=http://www.hombresropainterior.com/slip-ck-modal-verde-y-azul-p-452.html]calvin klein bolsos hombre[/url] “demographic,” but this does not include people who disagree with the sexual
    Ответить
    • блин, опять иностранные сеооптимизаторы срут на говнокоде...
      они настолько тупы, что не знают, что здесб ббкод url не работает...
      Ответить

Добавить комментарий

Переведи на "PHP", guest!

    А не использовать ли нам bbcode?


    8