You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2009/02/23 10:45:02 UTC

[jira] Commented: (DIRSERVER-1313) Potential NPEs while loading LDIFs in unit tests

    [ https://issues.apache.org/jira/browse/DIRSERVER-1313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675834#action_12675834 ] 

Emmanuel Lecharny commented on DIRSERVER-1313:
----------------------------------------------

Funny enough, if the code is like that (ie, instead of one line like new File( Class.forName( classname ).getRessource( ldifFile ).toURI() ) ), it's because I had a NPE, and I wanted to find which method was generating this NDP :)

let me fix the code.

> Potential NPEs while loading LDIFs in unit tests
> ------------------------------------------------
>
>                 Key: DIRSERVER-1313
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1313
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Pierre-Arnaud Marcelot
>             Fix For: 1.5.5
>
>
> There are potential NPEs while loading LDIFs in unit tests.
> Class: org.apache.directory.server.core.integ.state.AbstractState
> Method: protected void injectLdifs( DirectoryService service, InheritableSettings settings )
> Lines 195 to 198.
> [...]
>     Class<?> clazz = Class.forName( className );
>     URL url = clazz.getResource( ldifFile );
>     URI uri = url.toURI();
>     File file = new File( uri );
> [...]
> There are no check here to see either the 'clazz', 'url',  'uri' or 'file' variables are null. 
> If one of them is null, we'll get a NPE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.