mcconnell 2003/07/12 06:11:06
Modified: meta/api/src/java/org/apache/avalon/meta/info
InfoDescriptor.java
Log:
Added multiple null tests on hashCode implementation.
Revision Changes Path
1.5 +13 -4
avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/InfoDescriptor.java
Index: InfoDescriptor.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/InfoDescriptor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InfoDescriptor.java 11 Jul 2003 15:50:01 -0000 1.4
+++ InfoDescriptor.java 12 Jul 2003 13:11:06 -0000 1.5
@@ -275,9 +275,18 @@
hash >>>= 7;
hash ^= m_classname.hashCode();
hash >>>= 7;
- hash ^= m_name.hashCode();
- hash >>>= 7;
- hash ^= m_lifestyle.hashCode();
+
+ if ( null != m_name )
+ {
+ hash >>>= 7;
+ hash ^= m_name.hashCode();
+ }
+
+ if ( null != m_lifestyle )
+ {
+ hash >>>= 7;
+ hash ^= m_lifestyle.hashCode();
+ }
if ( null != m_version )
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]