Question on isExpressionLanguagePresent

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question on isExpressionLanguagePresent

Uwe@Moosheimer.com
Dear Experts,

the following code throws a NPE: 

    /PropertyValue property = context.getProperty(SOME_PROPERTY);//
    //if (property.isExpressionLanguagePresent()) {/

when the property is not set (NULL).

So I have to write

    /PropertyValue property = context.getProperty(SOME_PROPERTY);//
    //if (property.isSet() && property.isExpressionLanguagePresent()) {
    /

Wouldn't it be great if the method isExpressionLanguagePreset() would
check for NULL and then return false?

Best Regards,
Uwe


Reply | Threaded
Open this post in threaded view
|

Re: Question on isExpressionLanguagePresent

Joe Witt
Yep.  Please file a jira.

Thanks

On Sep 3, 2017 11:20 AM, "[hidden email]" <[hidden email]> wrote:

> Dear Experts,
>
> the following code throws a NPE:
>
>     /PropertyValue property = context.getProperty(SOME_PROPERTY);//
>     //if (property.isExpressionLanguagePresent()) {/
>
> when the property is not set (NULL).
>
> So I have to write
>
>     /PropertyValue property = context.getProperty(SOME_PROPERTY);//
>     //if (property.isSet() && property.isExpressionLanguagePresent()) {
>     /
>
> Wouldn't it be great if the method isExpressionLanguagePreset() would
> check for NULL and then return false?
>
> Best Regards,
> Uwe
>
>
>