commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <br...@apache.org>
Subject Re: svn commit: r233505 - in /jakarta/commons/proper/configuration/trunk/src:
Date Mon, 22 Aug 2005 06:55:07 GMT
How?

if keyBuffer is null (which it isn't, the constructor initialises it),
String.valueOf( keyBuffer ) would be an NPE as well. toString() should
not return null and won't for a StringBuffer.

- Brett

Henning P. Schmiedehausen wrote:

>oheger@apache.org writes:
>
>  
>
>>    public int hashCode()
>>    {
>>-        return keyBuffer.hashCode();
>>+        return keyBuffer.toString().hashCode();
>>    }
>>    
>>
>
>This screams "NullPointerException" all over the place.
>
>How about
>
>public int hashCode() {
>	return String.valueOf(keyBuffer).hashCode();
>}
>
>	Regards
>		Henning
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message