Skip to content

Commit

Permalink
[JENKINS-69153] Do not call deprecated h.singletonList (#71)
Browse files Browse the repository at this point in the history
* Do not call deprecated h.singletonList

Jenkins 2.358 deprecated the `Functions.singletonList` method because
it is not normally needed in JEXL.  The `h.singletonList(it)` call in
this groovy code reports a null pointer exception in Jenkins 2.358 and
later.

When the `h.singletonList(it)` call is replaced with `it`, the null
pointer exception is not reported and the page loads.

* Pass a list

Co-authored-by: Jesse Glick <jglick@cloudbees.com>

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
  • Loading branch information
MarkEWaite and jglick committed Sep 28, 2022
1 parent 45b0f29 commit a36bd90
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ l.side_panel() {
l.task(icon:"icon-next icon-md", href:"${rootURL}/emailexttemplates", title:_("Editable Email Templates"))
l.task(icon:"icon-new-package icon-md", href:"addTemplate", title:_("Add New Template"))
}
t.executors(computers:h.singletonList(it))
t.executors(computers: [it])
}

0 comments on commit a36bd90

Please sign in to comment.