[ 
https://issues.apache.org/jira/browse/FELIX-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Unico Hommes updated FELIX-2745:
--------------------------------

       Priority: Critical  (was: Major)
    Description: 
Line 216:

        Hashtable old = new Hashtable(new 
DictionaryAsMap(config.getProperties()));

in ConfigInstaller.java causes NPE when the configuration is new because 
config.getProperties returns null.

I fixed the problem on my local copy by changing the code to:

        Dictionary dict = config.getProperties();
        if (dict == null) dict = new Hashtable();

        Hashtable old = new Hashtable(new DictionaryAsMap(dict));


  was:
Line 216:

        Hashtable old = new Hashtable(new 
DictionaryAsMap(config.getProperties()));

in ConfigInstaller.java causes NPE when the configuration is new because 
config.getProperties returns null.

I fixed the problem by changing the code to:

        Dictionary dict = config.getProperties();
        if (dict == null) dict = new Hashtable();

        Hashtable old = new Hashtable(new DictionaryAsMap(dict));


        Summary: New configurations throw NPE  (was: New configurations throws 
NPE)

Perhaps my description of the issue was insufficient to convey how critical it 
is, seeing that no work or comments are logged for it yet. This bug makes 
FileInstall 3.1.2 simply unusable for people that want to use it for 
configuration. Also the NPE gets swallowed somewhere and unless you figure out 
how to set logging to WARNING level (which I can't seem to get working) nothing 
is reported. I had to run the debugger to find out what was happening.


> New configurations throw NPE
> ----------------------------
>
>                 Key: FELIX-2745
>                 URL: https://issues.apache.org/jira/browse/FELIX-2745
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-3.1.2
>            Reporter: Unico Hommes
>            Priority: Critical
>
> Line 216:
>         Hashtable old = new Hashtable(new 
> DictionaryAsMap(config.getProperties()));
> in ConfigInstaller.java causes NPE when the configuration is new because 
> config.getProperties returns null.
> I fixed the problem on my local copy by changing the code to:
>         Dictionary dict = config.getProperties();
>         if (dict == null) dict = new Hashtable();
>         Hashtable old = new Hashtable(new DictionaryAsMap(dict));

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

Reply via email to