Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.
vlad_roubtsov
member
Reged: 06/21/03
Posts: 169
|
Re: Bad exception handling, again
08/26/03 01:28 PM
|
|
|
Thanks for the feedback. A couple of counter-arguments:
(a) if the resource cannot be loaded, null is returned if THROW_ON_LOAD_FAILURE is false (to be consistent with ClassLoader.getResourceAsStream() behavior) and an exception is thrown if this flag is true. The only exception that is truly ignored in my code is the one resulting from in.close() -- I have yet to find a reason why not doing so would be useful in any shape or form.
(b) you may have noticed that people who write articles tend to simplify error handling in their posted code anyway: this is to keep things clear and focus on the subject matter instead of details of error handling. The code is not there to be used as is/literally with no changes anyway, but to be read, understood, and reused as fits best for your application.
|
|
0 registered and 3 anonymous users are browsing this forum.
Moderator:
|
Forum Permissions
You cannot start new topics
You cannot reply to topics
HTML is disabled
UBBCode is enabled
|
Rating:
Thread views: 15576
|
|
|
|
|
|
Powered by UBB.threads™ 6.5.5