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

Unserializable iterator & entry classes from Java Collections

      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.

          [JENKINS-27421] Unserializable iterator & entry classes from Java Collections

          Jesse Glick created issue -

          A C added a comment -

          bump The inability to use collection iterators at all is a very significant limitation.

          A C added a comment - bump The inability to use collection iterators at all is a very significant limitation.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-25925 [ JENKINS-25925 ]

          Jesse Glick added a comment -

          Workarounds:

          · Use a plain C-style for-loop.
          · Wrap the code in a method marked @NonCps, assuming it does not invoke anything interruptible (incl. calling Workflow steps).

          Jesse Glick added a comment - Workarounds: · Use a plain C-style for -loop. · Wrap the code in a method marked @NonCps , assuming it does not invoke anything interruptible (incl. calling Workflow steps).

          Owen Mehegan added a comment -

          Being able to write:

          node('linux_slave', 'windows_slave') {
          // some steps to run in parallel on both slaves
          }

          would be fantastic.

          Owen Mehegan added a comment - Being able to write: node('linux_slave', 'windows_slave') { // some steps to run in parallel on both slaves } would be fantastic.

          Jesse Glick added a comment -

          owenmehegan you can already do that using

          def labels = ['linux', 'windows']
          for (int i = 0; i < labels.size(); i++) {
            node(labels.get(i)) {
              // something, though you presumably need to select sh vs. bat here
            }
          }
          

          Jesse Glick added a comment - owenmehegan you can already do that using def labels = [ 'linux' , 'windows' ] for ( int i = 0; i < labels.size(); i++) { node(labels.get(i)) { // something, though you presumably need to select sh vs. bat here } }
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 206 (Web Link)" [ 13145 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/SerializationTest.java
          http://jenkins-ci.org/commit/workflow-plugin/e916b5e9f35b00db679360dc29e42658d566efb7
          Log:
          JENKINS-27421 Reproduced in test.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/SerializationTest.java http://jenkins-ci.org/commit/workflow-plugin/e916b5e9f35b00db679360dc29e42658d566efb7 Log: JENKINS-27421 Reproduced in test.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/PersistenceFailureTest.java
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/PersistenceProblemStep.java
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/PersistenceProblemStepExecution.java
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/SerializationTest.java
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java
          http://jenkins-ci.org/commit/workflow-plugin/61b7d70b1238d9d66dea22f497cac26debaaf88e
          Log:
          Merge pull request #206 from jglick/Itr-JENKINS-27421

          JENKINS-27421 Investigating ArrayList.Itr problem

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/a24f13091cf8...61b7d70b1238

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/PersistenceFailureTest.java aggregator/src/test/java/org/jenkinsci/plugins/workflow/PersistenceProblemStep.java aggregator/src/test/java/org/jenkinsci/plugins/workflow/PersistenceProblemStepExecution.java aggregator/src/test/java/org/jenkinsci/plugins/workflow/SerializationTest.java aggregator/src/test/java/org/jenkinsci/plugins/workflow/WorkflowTest.java http://jenkins-ci.org/commit/workflow-plugin/61b7d70b1238d9d66dea22f497cac26debaaf88e Log: Merge pull request #206 from jglick/Itr- JENKINS-27421 JENKINS-27421 Investigating ArrayList.Itr problem Compare: https://github.com/jenkinsci/workflow-plugin/compare/a24f13091cf8...61b7d70b1238

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

              Created:
              Updated:
              Resolved: