proyal      2002/06/25 06:43:02

  Modified:    src/java/org/apache/avalon/framework Enum.java
  Log:
  Remove potential NPE
  
  Revision  Changes    Path
  1.12      +10 -3     
jakarta-avalon/src/java/org/apache/avalon/framework/Enum.java
  
  Index: Enum.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/Enum.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Enum.java 25 Jun 2002 13:30:29 -0000      1.11
  +++ Enum.java 25 Jun 2002 13:43:01 -0000      1.12
  @@ -156,9 +156,16 @@
        */
       public final boolean equals( final Object other )
       {
  -        return other == this ||
  -            ( other.getClass().getName().equals( this.getClass().getName() ) 
&&
  -            m_name.equals( ((Enum) other).m_name ) );
  +        if( null == other )
  +        {
  +            return false;
  +        }
  +        else
  +        {
  +            return other == this ||
  +              ( other.getClass().getName().equals( this.getClass().getName() 
) &&
  +              m_name.equals( ( ( Enum ) other ).m_name ) );
  +        }
       }
       
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to