Forgive me if part of this task is also adding the UnsupportedOperationException for these operators - only, the wording suggests the exception is already present, otherwise, I've stumbled across this because I tried to use a spread method call and received the following exception instead:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.util.Collections$UnmodifiableRandomAccessList.getShortDescription() is applicable for argument types: () values: []
def rawCauses = currentBuild.rawBuild.getCauses()
def causes = rawCauses*.getShortDescription()
I then tried to use collect, and of course found JENKINS-26481
(I switched to a for loop)
In both cases, it would be a huge advantage to someone learning Pipeline and Groovy if Jenkins would reject these with clear exceptions.
Forgive me if part of this task is also adding the UnsupportedOperationException for these operators - only, the wording suggests the exception is already present, otherwise, I've stumbled across this because I tried to use a spread method call and received the following exception instead:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.util.Collections$UnmodifiableRandomAccessList.getShortDescription() is applicable for argument types: () values: []
I then tried to use collect, and of course found
(I switched to a for loop)
JENKINS-26481In both cases, it would be a huge advantage to someone learning Pipeline and Groovy if Jenkins would reject these with clear exceptions.