Script.main(String[]) vs. Script.main() ArrayIndexOutOfBoundsException

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The script

      node {
        writeFile file: 'x', text: 'def main() {}; this'
        load('x').main()
      }
      

      fails

      java.lang.ArrayIndexOutOfBoundsException: 0
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovyCallSiteSelector.isMoreSpecific(GroovyCallSiteSelector.java:230)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovyCallSiteSelector.findMatchingMethod(GroovyCallSiteSelector.java:178)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovyCallSiteSelector.method(GroovyCallSiteSelector.java:146)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:78)
          at ...
      

      whereas if you pick a different name it is OK.

      Claimed to be a regression in 1.22 though it seems unlikely those changes are related.

            Assignee:
            Jesse Glick
            Reporter:
            Jesse Glick
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: