Prepare Update to Groovy 2.x

I removed any usages of deprecated Groovy API to prepare an update to Groovy 2.x in Jenkins core.

See https://github.com/jenkinsci/jenkins/pull/1085 for details.