Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 06/Jan/15 12:08 PM
Description:

To demonstrate the issue createa new workflow job with the following script:

def str="1:one|2:two|3:three"
def i = "2"
def opts = str.split(/\|/)
def opt = opts.find { o -> o.contains("${i}:") }
echo "len: ${opts.length}"
echo "opt: ${opt}"

The output of which is


Started by user anonymous
Running: Print Message
len: 3
Running: Print Message
opt: false
Running: End of Workflow
Finished: SUCCESS

Note the value returned for opt. It appears that the current behavior of find in cps is to return the result of the closure for the first element in the collection.

Environment: Workflow 1.1 and Jenkins 1.596
Project: Jenkins
Priority: Major Major
Reporter: Kenneth Baltrinic
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to