Hacker News new | past | comments | ask | show | jobs | submit login

How it's written here it won't be null. However the general pattern is to check for null in the finally block since it may not be provable that the stream is non-null (e.g. created in a library call or similar). In fact the try-with-resources feature handles the null case as well.



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

Search: