You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2018/03/17 20:33:00 UTC

[jira] [Commented] (CONFIGURATION-689) NullPointerException in ExprLookup when not using variables

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

Oliver Heger commented on CONFIGURATION-689:
--------------------------------------------

This is true; however, the NPE is not propagated to the outside, but caught and logged. The lookup operation returns the same variable that has been passed in.

The default constructor could be modified to set an empty Variables object, but without further modifications this would change the behavior of the class: A lookup on an undefined variable would then return *null* rather than the variable name.

Do you have a concrete use case in which this internal NPE causes a problem?

> NullPointerException in ExprLookup when not using variables
> -----------------------------------------------------------
>
>                 Key: CONFIGURATION-689
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-689
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 2.2
>            Reporter: Steven Paligo
>            Priority: Major
>
> When an ExprLookup instance is created with the default constructor, the "variables" object is null. During a lookup, initializeContext(JexlContext) iterates over "variables" which triggers a NullPointerException.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)