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

Unserializable iterator & entry classes from Java Collections

    XMLWordPrintable

Details

    Description

      Not currently possible to use a Java 5-style for loop on an ArrayList (for example) from within CPS-transformed code, since its Iterator implementation is not marked Serializable.

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment -

            autarchprinceps / rpocase please do not reopen. If you continue to have issues, file fresh bug reports with complete steps to reproduce from scratch and link them to this one.

            jglick Jesse Glick added a comment - autarchprinceps / rpocase please do not reopen. If you continue to have issues, file fresh bug reports with complete steps to reproduce from scratch and link them to this one.
            rpocase Robby Pocase added a comment -

            For me, this bug is really inconsistent. I've hit this in production pipelines but then be unable to generate a minimal reproduction. I'm going to get a sample job as I have time.

            rpocase Robby Pocase added a comment - For me, this bug is really inconsistent. I've hit this in production pipelines but then be unable to generate a minimal reproduction. I'm going to get a sample job as I have time.

            This is still broken, being able to explain why isn't the same as fixing it. And it definitively is a bug. The same code works fine in raw Groovy.

            autarchprinceps autarch princeps added a comment - This is still broken, being able to explain why isn't the same as fixing it. And it definitively is a bug. The same code works fine in raw Groovy.
            jglick Jesse Glick added a comment -

            The fix is not sensitive to the implementation class of the collection but it is specific to the interface method being used to produce an iterator. Commonly used methods should be covered but there are surely some things missing. You can review IteratorHack and its test for details.

            jglick Jesse Glick added a comment - The fix is not sensitive to the implementation class of the collection but it is specific to the interface method being used to produce an iterator. Commonly used methods should be covered but there are surely some things missing. You can review IteratorHack and its test for details.

            Great to see that a solution is implemented.

            I've got one question, though:

            Will the solution work for any collections and allow all kind of different possibilities to iterate through them?

            macdrega Joerg Schwaerzler added a comment - Great to see that a solution is implemented. I've got one question, though: Will the solution work for any collections and allow all kind of different possibilities to iterate through them?

            People

              jglick Jesse Glick
              jglick Jesse Glick
              Votes:
              38 Vote for this issue
              Watchers:
              59 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: