| Yes, I also agree. This has to be fixed. I've just spent two days of my life trying to figure out what was wrong with my pipeline script. My Groovy code worked perfectly in Jenkin's Script Console, but once put in a Jenkinsfile strange things happened. In my case it was not sort() but toSorted() which has the same problem. The following code snipplet
List<String> foo = ["hello","hi","hey"].toSorted { a, b -> a.length() <=> b.length() }
println foo.toString()
taken straight from the toSorted() specification in the Groovy Docs. In Jenkin's Script Console the output was
which is correct. When run from a Jenkinsfile the build's output, however, was
This is not acceptable and certainly not a "Minor" issue, because it costs a lot of time and money to hunt down these kinds of bugs! |