karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (KARAF-4376) Make grep return the list of results rather than null
Date Wed, 07 Sep 2016 10:03:20 GMT

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

Guillaume Nodet reassigned KARAF-4376:
--------------------------------------

    Assignee: Guillaume Nodet

> Make grep return the list of results rather than null
> -----------------------------------------------------
>
>                 Key: KARAF-4376
>                 URL: https://issues.apache.org/jira/browse/KARAF-4376
>             Project: Karaf
>          Issue Type: Improvement
>          Components: karaf-shell
>            Reporter: Jim Sermersheim
>            Assignee: Guillaume Nodet
>
> It seems natural to run 'each' over the result of grep, but this causes a NullPointerException.
I suppose because GrepAction.execute() returns null rather than list (the ArrayList holding
the filtered results).
> For example:
> {noformat}
> > a = [ben bart pen]
> ben
> bart
> pen
> > echo $a
> [ben, bart, pen]
> > b = ($a | grep en)
> ben
> pen
> > each ($b) { echo $it }
> Error: java.lang.NullPointerException
> > echo $b
> Error: java.lang.NullPointerException
> > echo ($a size)
> 3
> > echo ($b size)
> Error: Command name evaluates to null: $b
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message