Hi Roland you implement an additional class and perform
unnecessary method calls to avoid null checks? I must be getting old ;-)
Lol. Valid point though on the additional method calls. I'm simply used to write the code with maximum readability quite high on my priority list. It might not apply here. The overhead in this particular case is not a
problem, so I would agree to apply the patch if you provide one. However, I have to insist on additional comments in your inner class, like: return true; // close the stream
certainly no problem. In the current code, the line that assigns a
default to "scws" explains itself, or can be understood by skipping two lines down. In your suggestion, "return true" carries no meaning. You have to cross-reference with either the JavaDocs in the interface or the actual call to understand what "true" or "false" means. Prettier code is not always more readable.
It's always interesting to get different views on a programming subject, especially if the other developer is used to different programming habits. Since I'm using IDE's or enhanced editors, the javadoc is a mouse movement or a keypress away, and I can jump to implementing methods also very easily. So I guess this influences my view of code readability. It's your decision what to do with this one. I'll provide the patch if you're interested. Cheers, Daniel
