title: Jenkins declarative pipeline throws org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified getAt method
body: <p>I have defined a shared library in Jenkins:</p>
  
  <pre><code>import com.codependent.jenkins.pipelines.Utils
  
  def call(List&lt;String&gt; mavenGoals){
    def processedMavenGoals = mavenGoals.join ' '
    pipeline {
      agent any
    ...
  }
  </code></pre>
  
  <p>If i call this from my project's Jenkinsfile like this it works ok:</p>
  
  <pre><code>#!groovy
  @Library('jenkins-pipeline-shared-library-example') _
  buildPipeline(['clean', 'install'])
  </code></pre>
  
  <p>However if I omit the parethesis as Groovy syntax allows:</p>
  
  <pre><code>#!groovy
  @Library('jenkins-pipeline-shared-library-example') _
  buildPipeline ['clean', 'install']
  </code></pre>
  
  <p>The execution shows the folloing exception. Why?</p>
  
  <pre><code>org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified getAt method buildPipeline[java.util.ArrayList]
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetArray(SandboxInterceptor.java:451)
      at org.kohsuke.groovy.sandbox.impl.Checker$10.call(Checker.java:413)
      at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetArray(Checker.java:418)
      at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getArray(SandboxInvoker.java:45)
      at com.cloudbees.groovy.cps.impl.ArrayAccessBlock.rawGet(ArrayAccessBlock.java:21)
      at WorkflowScript.run(WorkflowScript:3)
      at ___cps.transform___(Native Method)
  </code></pre>