directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: Potential for ClassCastException in DefaultPartitionNexus.java?
Date Thu, 14 Feb 2008 16:17:56 GMT
Kiran Ayyagari wrote:
>
> how about using findbugs (http://findbugs.sourceforge.net/), a static 
> analysis tool.
>
> I just tried this now and found some issues for e.x
>
>  ExpressionEnumerator.java line 135
>      else if ( node instanceof ApproximateNode )
>      {
>        list = enumEquality( ( EqualityNode ) node ); // line 135 This 
> cast will always throw a ClassCastException
>      }
True. Big bug ! Can you fill a JIRA ?
>
> A possible return of null value in the below code
>
> public final boolean isValid() throws NamingException
>    {
>        if ( valid != null )
>        {
>            return valid;
>        }
>
>        return valid;
>    }
Another big bug. Another JIRA ?
>
> and a possible NPE at line 963 of RdnParser.java (no null check while 
> calling this method)
>
>    rdn.setUpName( StringTools.utf8ToString( dn, start, pos.end - start 
> ) );
Just fixed. Thanks !
>
> There might be some false positives like the one given bellow but its 
> good in catching many valid cases like above.
Yeah... So many remaining bugs ;) This is a large code base, and I'm not 
surprised we found such bugs !

Thanks Kiran !

-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message