Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 05F0C200B8C for ; Mon, 12 Sep 2016 11:46:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 04BA4160AD9; Mon, 12 Sep 2016 09:46:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 78E05160AB8 for ; Mon, 12 Sep 2016 11:46:21 +0200 (CEST) Received: (qmail 24548 invoked by uid 500); 12 Sep 2016 09:46:20 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 24528 invoked by uid 99); 12 Sep 2016 09:46:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Sep 2016 09:46:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 91FB62C1B7D for ; Mon, 12 Sep 2016 09:46:20 +0000 (UTC) Date: Mon, 12 Sep 2016 09:46:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KARAF-4376) Make grep return the list of results rather than null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Sep 2016 09:46:22 -0000 [ https://issues.apache.org/jira/browse/KARAF-4376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15483662#comment-15483662 ] ASF GitHub Bot commented on KARAF-4376: --------------------------------------- Github user avdyk closed the pull request at: https://github.com/apache/karaf/pull/175 > 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 > Fix For: 4.1.0 > > > 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)