db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TomohitoNakayama <tomon...@basil.ocn.ne.jp>
Subject Re: [jira] Commented: (DERBY-1471) Implement layer B streaming for new methods defined in JDBC4.0
Date Thu, 14 Dec 2006 12:59:04 GMT

I think an efforts for readability of code came to improve stability of 
Please read next patch and  give me  your opinion.

Best regards.

Knut Anders Hatlen wrote:

>TomohitoNakayama <tomonaka@basil.ocn.ne.jp> writes:
>>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



View raw message