Hello.
I think an efforts for readability of code came to improve stability of
code.
Please read next patch and give me your opinion.
Best regards.
Knut Anders Hatlen wrote:
TomohitoNakayama <[EMAIL PROTECTED]> writes:
Hello.
Knut Anders Hatlen (JIRA) wrote:
[...]
if (stream == null) {
// same code as before for null
} else if (stream instanceof LayerBStreamedEXTDTAReaderInputStream) {
// new Layer B code
} else {
// same code as in the old else-clause
}
The main point is that we should have an "else" clause at the end
which catches all cases, instead of only having "if" and "else if"
clauses. I think that it will make the code clearer, since a reader
doesn't have to figure out whether there are cases that don't match
any of the if/else-if clauses.
See ...
I want to state explicitly that stream is instance of
LayerBStreamedEXTDTAReaderInputStream or StandardEXTDTAReaderInputStream.
Now I think what is needed is the last else clause as error processing.
I don't think it is necessary to create a new error message and throw
an exception in this case. My comment was primarily about readability,
not error checking, and if you want to keep the instanceof check for
StandardEXTDTAReaderInputStream, I think it's enough to add a comment
saying that the stream is always one of those types.
--
/*
Tomohito Nakayama
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Naka
http://www5.ocn.ne.jp/~tomohito/TopPage.html
*/