1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

make unstash work for parallel executions (#2095)

without 'int' in a 'for (i = 0; ...)' loop 'i' is
a global variable and the value gets inside some parallel
execution randomly incremented from the parallel threads.

Defining it with the keyword 'int' makes it a method local
variable which does not change its value 'randomly'.

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
Marcus Holl
2020-09-30 13:10:40 +02:00
committed by GitHub
parent fc55d02230
commit 0a17ed561e

View File

@@ -92,7 +92,7 @@ def unstash(name, msg = "Unstash failed:") {
def unstashAll(stashContent) {
def unstashedContent = []
if (stashContent) {
for (i = 0; i < stashContent.size(); i++) {
for (int i = 0; i < stashContent.size(); i++) {
if (stashContent[i]) {
unstashedContent += unstash(stashContent[i])
}