David W. Van Couvering wrote:

> 
> 
> Bryan Pendleton wrote:
> 
>>
>> 2) It seems like it might be possible to improve these lines in
>>    ReEncodedInputStream.java:
>>
>>         if(reader == null){
>>             throw new NullPointerException();
>>         }
>>
>>         if(enc == null){
>>             throw new NullPointerException();
>>         }
>>
>>    I think it would be better to pass a string to the exception
>>    constructor, indicating which variable was null, as in:
>>
>>             throw new NullPointerException(
>>                 "null 'reader' passed to ReEncodedInputStream");
> 

Actually, I'd be interested to know why such tests are required? Why is
there a need to throw a NPE if a parameter or variable is null?

It's not a coding style I like.

Dan.

Reply via email to