Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50869

Calling `empty` on Groovy list leads to a list being returned, not correct check

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • script-security-plugin
    • None
    • Jenkins 2.117
      Script Security 1.44

      Steps to reproduce:

      1. Create a freestyle job
      2. Add "Execute system Groovy script" build step
      3. Add content (see below)
      4. Run build with "Use Groovy Sandbox" enabled.
      5. Run without "Use Groovy Sandbox" enabled

       

      def someArrayList = []
      
      println someArrayList.empty
      

      This works when the sandbox is disabled, but when sandbox is enabled it returns

      []
      

      Instead of

      true
      

      like it should.

      After downgrading back from Script Security 1.44 to 1.43 the problem is fixed.
      I suspect https://issues.jenkins-ci.org/browse/JENKINS-50470 is the problem

            Unassigned Unassigned
            kylec_32 Kyle Carter
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: