[JIRA] (JENKINS-57651) Trying to print a GString somehow causes pipeline code to be silently skipped

2019-05-23 Thread trej...@trypticon.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 trejkaz updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-57651  
 
 
  Trying to print a GString somehow causes pipeline code to be silently skipped   
 

  
 
 
 
 

 
Change By: 
 trejkaz  
 
 
Issue Type: 
 Improvement Bug  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.199582.1558669265000.10828.1558672260083%40Atlassian.JIRA.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-57651) Trying to print a GString somehow causes pipeline code to be silently skipped

2019-05-23 Thread trej...@trypticon.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 trejkaz created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-57651  
 
 
  Trying to print a GString somehow causes pipeline code to be silently skipped   
 

  
 
 
 
 

 
Issue Type: 
  Improvement  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 pipeline  
 
 
Created: 
 2019-05-24 03:41  
 
 
Priority: 
  Major  
 
 
Reporter: 
 trejkaz  
 

  
 
 
 
 

 
 The following pipeline: 

 

List buildFlavours = ['ubuntu', 'macosx']
List modulesGroups = [
  new MyBuildStep('UnitTestGroup1'),
  new MyBuildStep('UnitTestGroup2')
]

println "*** outside loop, buildFlavours.size() = ${buildFlavours.size()}"
buildFlavours.each { flavour ->
  println "*** inside loop, flavour = ${flavour}"
  println "*** outside loop, modulesGroups.size() = ${modulesGroups.size()}"
  modulesGroups.each { group ->

// Doesn't work, silently terminates the iteration of the loop with no error either!
println "*** inside loop, group = ${group}"

// Somehow this works:
// String groupCopy = group.toString()
// println "*** inside loop, group = ${groupCopy}"
}
}

class MyBuildStep implements Serializable {
private String displayName

MyBuildStep(String displayName) {
this.displayName = displayName
}

@Override
String toString() {
return displayName
}
}
 

 Prints the following output: 

 
[Pipeline] echo
*** outside loop, buildFlavours.size() = 2
[Pipeline] echo
*** inside loop, flavour = ubuntu
[Pipeline] echo
*** outside loop, modulesGroups.size() = 2
[Pipeline] echo
*** inside loop, flavour = macosx
[Pipeline] echo
*** outside