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

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
/**
  * Getter for billbackAdjustmentType 
  *
  * @return the billbackAdjustmentType instance
  */
public BillbackAdjustmentType getBillbackAdjustmentType() {
    return billbackAdjustmentType != null ? billbackAdjustmentType : BillbackAdjustmentType.PlusBillbackAdjustment;
}

...и попробуй такое найди под дебагом :)

guest guest, (Updated )

Комментарии (9, +9)

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

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
public static Date createDate(Integer iYear, Integer iMonth, Integer iDay) throws Exception
    {
        if ((!(iYear instanceof Integer))
                || (!(iMonth instanceof Integer))
                || (!(iDay instanceof Integer))
                )
        {
            throw new Exception();
        }

        Date date = null;
        String year, month, day;

        year = iYear.toString();
        month = iMonth.toString();
        day = iDay.toString();
        try
        {
            date = new SimpleDateFormat("yyyy/MM/dd").parse(year + "/" + month + "/" + day);

        } catch (ParseException e)
        {
            log.warn("Date transformation failed for year, month, day:  " + iYear + ", " + iMonth + ", " + iDay);
        }
        return date;
    }

Индусы Рулят!!!

guest guest, (Updated )

Комментарии (25, +25)

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

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
public boolean foo(...){
  ...
  try{
  ...
  }
  finally{
    if(expr_1){
      return false;
    }
    if(expr_2){
      return false;
    }
    ...
    if(expr_n){
      return false;
    }
  }
  ...
  return true;
}

поймал на сопровождении, долго курил (метод на 3 экранах)

guest guest, (Updated )

Комментарии (10, +10)