Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4376

Make grep return the list of results rather than null

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0
    • Component/s: karaf
    • Labels:
      None

      Description

      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:

      > 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
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gnt Guillaume Nodet
                Reporter:
                jimse Jim Sermersheim
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: