commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CONFIGURATION-282) NPE in HierarchicalConfiguration.fetchNodeList
Date Mon, 09 Jul 2007 19:47:06 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511235
] 

Oliver Heger commented on CONFIGURATION-282:
--------------------------------------------

A fix was committed that initializes the default expression engine every time if it is null.
Can you please check whether this solves your problem?

Unfortunately I have no idea how to write a unit test that demonstrates the problem. However
because the defaultExpressionEngine field is now null at the beginning, code coverage should
be complete.

There is now some additional overhead because of the required synchronization of the static
getDefaultExpressionEngine() method, which also gets called if no specific expression engine
is set for a configuration instance. This could be avoided if the default expression engine
is fetched once in the constructor of HierarchicalConfiguration and copied into the member
field for the local expression engine. The drawback is that this could break existing code
that relies on the fact that changing the default expression engine immediately impacts all
configuration instances that have no specific expression engine set. So I would prefer making
this change only in a major release.

> NPE in HierarchicalConfiguration.fetchNodeList
> ----------------------------------------------
>
>                 Key: CONFIGURATION-282
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-282
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Linux, Java 1.5
>            Reporter: Dennis Kieselhorst
>            Assignee: Oliver Heger
>
> java.lang.NullPointerException
>         at org.apache.commons.configuration.HierarchicalConfiguration.fetchNodeList(HierarchicalConfiguration.java:721)
>         at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.fetchNodeList(AbstractHierarchicalFileConfiguration.java:338)
>         at org.apache.commons.configuration.HierarchicalConfiguration.getProperty(HierarchicalConfiguration.java:284)
>         at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.getProperty(AbstractHierarchicalFileConfiguration.java:319)
>         at org.apache.commons.configuration.AbstractConfiguration.resolveContainerStore(AbstractConfiguration.java:1222)
>         at org.apache.commons.configuration.AbstractConfiguration.getBoolean(AbstractConfiguration.java:667)
>         at org.apache.commons.configuration.AbstractConfiguration.getBoolean(AbstractConfiguration.java:633)
> java.lang.NullPointerException
>         at org.apache.commons.configuration.HierarchicalConfiguration.fetchNodeList(HierarchicalConfiguration.java:721)
>         at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.fetchNodeList(AbstractHierarchicalFileConfiguration.java:338)
>         at org.apache.commons.configuration.HierarchicalConfiguration.getProperty(HierarchicalConfiguration.java:284)
>         at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.getProperty(AbstractHierarchicalFileConfiguration.java:319)
>         at org.apache.commons.configuration.AbstractConfiguration.resolveContainerStore(AbstractConfiguration.java:1222)
>         at org.apache.commons.configuration.AbstractConfiguration.getString(AbstractConfiguration.java:1097)
>         at org.apache.commons.configuration.AbstractConfiguration.getString(AbstractConfiguration.java:1077)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message