Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    public List<Integer> add2(File file) {
      List<Integer> resultList = new ArrayList<>();
      for (int i : ListUtils.emptyIfNull(file.getNumbers())) {
        resultList.append(i + 2);
      }
      return resultList;
    }


And now you need to use a non-language builtin util everywhere. And this one only works when working with arrays or array like objects...

It's amazing how far people will go to defend a bad practice, than even its inventor called a 'billion dollar mistake'.


This returns an empty list when file fails to read, which is not the expected behavior.

That's a case that comes up a lot! DB read failed vs DB read 0 items for example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: