db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-1471) Implement layer B streaming for new methods defined in JDBC4.0
Date Wed, 13 Dec 2006 15:15:57 GMT
TomohitoNakayama <tomonaka@basil.ocn.ne.jp> 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.

-- 
Knut Anders

Mime
View raw message