I'm attempting to make use of the native Java priority queue in a pipeline job by defining the following custom class
and then attempting to run the following function
I would expect to get a priority queue with all of my stuff in it, but instead, checking the output console, I receive the following:
and then a Queue that looks like this
I realise that using the native PriorityQueue inside of a Jenkins job may be an incredibly niche use case. My attempts to google what exactly is going wrong here as well as this error has returned a net 0 results. Another weird thing I've noticed is that the first add seems to work fine. One item gets added to the PriorityQueue and every add after that suffers from the catching PriorityClosure.compareTo error.
Does anyone know what's going on here? I'm currently assuming this is a bug, but I realise this could also be a me problem.