Though the author is correct in advising to do exception handling like this[1] instead of this[2], they are not correct in the reasoning behind it. In method [2], if a writer cannot be instanciated, the code will still try to write with it, which will probably cause a NullPointerException. Rewriting to method [1] hinders this.
1 comment
[ 6.0 ms ] story [ 15.8 ms ] thread[1]: