mirror of
https://github.com/SAP/jenkins-library.git
synced 2026-06-19 22:58:55 +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:
co-authored by
Christopher Fenner
parent
fc55d02230
commit
0a17ed561e
@@ -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])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user