brianchandotcom/liferay-portal — pull request #6805 by shuyangzhou (2012-09-07 00:56:21+00:00)
Title: LPS-29720 Undo wrong/unnecessary changes. Whenever FileChannel is retrie...

...veLPS-29720 Undo wrong/unnecessary changes. Whenever FileChannel is retrieved from FileInput/OutputStream/RandomAccessFile, closing FileChannel is enough, as the parent resource is closed automatically. Whenever dealing with pure in memory IO, unless this is a helpful for GC(to null out internal buffer explicitly, rather than waiting GC to walk through object graph to detach them), closing is not necessary, some in memory IO's close is just a NP. More importantly, to do complete this meaningless close, it may force to refactor the code to do some try/finally with null checking which may create dead code(never called for sure, see ProcessExecutor change) breaks code coveraged from FileInput/OutputStream/RandomAccessFile, closing FileChannel is enough, as the parent resource is closed automatically. Whenever dealing with pure in memory IO, unless this is a helpful for GC, closing is not necessary, some in memory IO's close is just a NP. More importantly, to do complete this meaningless close, it may force to refactor the code to do some try/finally with null checking which may create dead code(never called for sure) breaks code coverage