On 10/08/2009 08:37 PM, Jesus M. Rodriguez wrote:
Hrm I haven't been paying attention to this, but you should never just
close FileWriters, etc.
The better approach is to use a try/catch to close it. We should never
really be throwing
IOExceptions when we can handle them, also logging a warning after
catching an IOException is not the best idea either.

jesus


Hello,

I respectfully disagree in this situation with the FileWriter. Here is my reasoning:

AuditManager.java:
- line 70: this needs to throw an exception on a failure to record audit review information - the handling of this is left to the caller.

The rest of the closes are on Readers - writing to a log file should be "okay" unless the system is really messed up. Looking back at the code, I probably could have been a little more consistent with what threw exceptions though - I throw an exception on failing to read audit review info, but not on reading the actual audit data.

I'm going to send out another email with all the patches I've accumulated.

Thanks,

Josh

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to