-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.138.1
Plugins:
ace-editor 1.1
analysis-core 1.95
android-emulator 3.0
android-lint 2.6
ansicolor 0.5.2
ant 1.8
antisamy-markup-formatter 1.5
apache-httpcomponents-client-4-api 4.5.5-3.0
async-http-client 1.9.40.0
authentication-tokens 1.3
authorize-project 1.3.0
badge 1.6
bitbucket 1.1.8
bitbucket-approve 1.0.3
bitbucket-build-status-notifier 1.4.1
bitbucket-pullrequest-builder 1.4.26
blueocean 1.8.4
blueocean-autofavorite 1.2.2
blueocean-bitbucket-pipeline 1.8.4
blueocean-commons 1.8.4
blueocean-config 1.8.4
blueocean-core-js 1.8.4
blueocean-dashboard 1.8.4
blueocean-display-url 2.2.0
blueocean-events 1.8.4
blueocean-git-pipeline 1.8.4
blueocean-github-pipeline 1.8.4
blueocean-i18n 1.8.4
blueocean-jira 1.8.4
blueocean-jwt 1.8.4
blueocean-personalization 1.8.4
blueocean-pipeline-api-impl 1.8.4
blueocean-pipeline-editor 1.8.4
blueocean-pipeline-scm-api 1.8.4
blueocean-rest 1.8.4
blueocean-rest-impl 1.8.4
blueocean-web 1.8.4
bouncycastle-api 2.17
branch-api 2.0.20
browserstack-integration 1.1.3
build-timeout 1.19
buildnotifications 1.1.1
checkmarx 8.80.0
checkstyle 3.50
chrome-frame-plugin 1.1
cli-commander 0.3
cloud-stats 0.19
cloudbees-bitbucket-branch-source 2.2.12
cloudbees-folder 6.6
codesonar 2.0.7
command-launcher 1.2
conditional-buildstep 1.3.6
config-file-provider 3.2
confluence-publisher 2.0.3
copyartifact 1.41
credentials 2.1.18
credentials-binding 1.16
crossbrowsertesting 2.5.5
dashboard-view 2.9.11
deployit-plugin 7.5.1
display-url-api 2.2.0
docker-commons 1.13
docker-java-api 3.0.14
docker-plugin 1.1.5
docker-workflow 1.17
durable-task 1.26
email-ext 2.63
envinject 2.1.6
envinject-api 1.5
external-monitor-job 1.7
favorite 2.3.2
git 3.9.1
git-client 2.7.3
git-parameter 0.9.5
git-server 1.7
github 1.29.2
github-api 1.92
github-branch-source 2.4.0
github-organization-folder 1.6
gitlab-plugin 1.5.10
gradle 1.29
groovy-postbuild 2.4.2
handlebars 1.1.1
handy-uri-templates-2-api 2.1.6-1.0
htmlpublisher 1.17
http_request 1.8.22
icon-shim 2.0.3
jackson2-api 2.8.11.3
jacoco 3.0.3
javadoc 1.4
jdk-tool 1.0
jenkins-design-language 1.8.4
jira 3.0.2
job-dsl 1.70
jquery 1.12.4-0
jquery-detached 1.2.1
jsch 0.1.54.2
junit 1.26.1
last-changes 2.6.1
ldap 1.20
locale 1.3
lockable-resources 2.3
mailer 1.21
mapdb-api 1.0.9.0
matrix-auth 2.3
matrix-project 1.13
maven-plugin 3.1.2
mercurial 2.4
metrics 4.0.2.2
momentjs 1.1.1
multiple-scms 0.6
naginator 1.17.2
next-build-number 1.5
nexus-artifact-uploader 2.10
nexus-jenkins-plugin 3.3.20180912-170211.be90294
nodejs 1.2.6
nunit 0.23
pam-auth 1.4
parameterized-trigger 2.35.2
permissive-script-security 0.3
pipeline-build-step 2.7
pipeline-github-lib 1.0
pipeline-graph-analysis 1.7
pipeline-input-step 2.8
pipeline-milestone-step 1.3.1
pipeline-model-api 1.3.2
pipeline-model-declarative-agent 1.1.1
pipeline-model-definition 1.3.2
pipeline-model-extensions 1.3.2
pipeline-rest-api 2.10
pipeline-stage-step 2.3
pipeline-stage-tags-metadata 1.3.2
pipeline-stage-view 2.10
pipeline-utility-steps 2.1.0
plain-credentials 1.4
port-allocator 1.8
postbuild-task 1.8
project-description-setter 1.2
publish-over 0.22
publish-over-ssh 1.20.1
pubsub-light 1.12
purge-build-queue-plugin 1.0
resource-disposer 0.12
role-strategy 2.9.0
run-condition 1.2
scm-api 2.2.8
script-security 1.46
skip-certificate-check 1.0
slack 2.3
sonar 2.8.1
sse-gateway 1.16
ssh-agent 1.17
ssh-credentials 1.14
ssh-slaves 1.28.1
structs 1.15
subversion 2.12.1
support-core 2.50
swarm 3.14
test-results-analyzer 0.3.5
timestamper 1.8.10
token-macro 2.5
uno-choice 2.1
variant 1.1
windows-slaves 1.3.1
workflow-aggregator 2.6
workflow-api 2.29
workflow-basic-steps 2.11
workflow-cps 2.57
workflow-cps-global-lib 2.12
workflow-durable-task-step 2.22
workflow-job 2.25
workflow-multibranch 2.20
workflow-remote-loader 1.4
workflow-scm-step 2.6
workflow-step-api 2.16
workflow-support 2.20
ws-cleanup 0.34
xlrelease-plugin 7.5.1Jenkins 2.138.1 Plugins: ace-editor 1.1 analysis-core 1.95 android-emulator 3.0 android-lint 2.6 ansicolor 0.5.2 ant 1.8 antisamy-markup-formatter 1.5 apache-httpcomponents-client-4-api 4.5.5-3.0 async-http-client 1.9.40.0 authentication-tokens 1.3 authorize-project 1.3.0 badge 1.6 bitbucket 1.1.8 bitbucket-approve 1.0.3 bitbucket-build-status-notifier 1.4.1 bitbucket-pullrequest-builder 1.4.26 blueocean 1.8.4 blueocean-autofavorite 1.2.2 blueocean-bitbucket-pipeline 1.8.4 blueocean-commons 1.8.4 blueocean-config 1.8.4 blueocean-core-js 1.8.4 blueocean-dashboard 1.8.4 blueocean-display-url 2.2.0 blueocean-events 1.8.4 blueocean-git-pipeline 1.8.4 blueocean-github-pipeline 1.8.4 blueocean-i18n 1.8.4 blueocean-jira 1.8.4 blueocean-jwt 1.8.4 blueocean-personalization 1.8.4 blueocean-pipeline-api-impl 1.8.4 blueocean-pipeline-editor 1.8.4 blueocean-pipeline-scm-api 1.8.4 blueocean-rest 1.8.4 blueocean-rest-impl 1.8.4 blueocean-web 1.8.4 bouncycastle-api 2.17 branch-api 2.0.20 browserstack-integration 1.1.3 build-timeout 1.19 buildnotifications 1.1.1 checkmarx 8.80.0 checkstyle 3.50 chrome-frame-plugin 1.1 cli-commander 0.3 cloud-stats 0.19 cloudbees-bitbucket-branch-source 2.2.12 cloudbees-folder 6.6 codesonar 2.0.7 command-launcher 1.2 conditional-buildstep 1.3.6 config-file-provider 3.2 confluence-publisher 2.0.3 copyartifact 1.41 credentials 2.1.18 credentials-binding 1.16 crossbrowsertesting 2.5.5 dashboard-view 2.9.11 deployit-plugin 7.5.1 display-url-api 2.2.0 docker-commons 1.13 docker-java-api 3.0.14 docker-plugin 1.1.5 docker-workflow 1.17 durable-task 1.26 email-ext 2.63 envinject 2.1.6 envinject-api 1.5 external-monitor-job 1.7 favorite 2.3.2 git 3.9.1 git-client 2.7.3 git-parameter 0.9.5 git-server 1.7 github 1.29.2 github-api 1.92 github-branch-source 2.4.0 github-organization-folder 1.6 gitlab-plugin 1.5.10 gradle 1.29 groovy-postbuild 2.4.2 handlebars 1.1.1 handy-uri-templates-2-api 2.1.6-1.0 htmlpublisher 1.17 http_request 1.8.22 icon-shim 2.0.3 jackson2-api 2.8.11.3 jacoco 3.0.3 javadoc 1.4 jdk-tool 1.0 jenkins-design-language 1.8.4 jira 3.0.2 job-dsl 1.70 jquery 1.12.4-0 jquery-detached 1.2.1 jsch 0.1.54.2 junit 1.26.1 last-changes 2.6.1 ldap 1.20 locale 1.3 lockable-resources 2.3 mailer 1.21 mapdb-api 1.0.9.0 matrix-auth 2.3 matrix-project 1.13 maven-plugin 3.1.2 mercurial 2.4 metrics 4.0.2.2 momentjs 1.1.1 multiple-scms 0.6 naginator 1.17.2 next-build-number 1.5 nexus-artifact-uploader 2.10 nexus-jenkins-plugin 3.3.20180912-170211.be90294 nodejs 1.2.6 nunit 0.23 pam-auth 1.4 parameterized-trigger 2.35.2 permissive-script-security 0.3 pipeline-build-step 2.7 pipeline-github-lib 1.0 pipeline-graph-analysis 1.7 pipeline-input-step 2.8 pipeline-milestone-step 1.3.1 pipeline-model-api 1.3.2 pipeline-model-declarative-agent 1.1.1 pipeline-model-definition 1.3.2 pipeline-model-extensions 1.3.2 pipeline-rest-api 2.10 pipeline-stage-step 2.3 pipeline-stage-tags-metadata 1.3.2 pipeline-stage-view 2.10 pipeline-utility-steps 2.1.0 plain-credentials 1.4 port-allocator 1.8 postbuild-task 1.8 project-description-setter 1.2 publish-over 0.22 publish-over-ssh 1.20.1 pubsub-light 1.12 purge-build-queue-plugin 1.0 resource-disposer 0.12 role-strategy 2.9.0 run-condition 1.2 scm-api 2.2.8 script-security 1.46 skip-certificate-check 1.0 slack 2.3 sonar 2.8.1 sse-gateway 1.16 ssh-agent 1.17 ssh-credentials 1.14 ssh-slaves 1.28.1 structs 1.15 subversion 2.12.1 support-core 2.50 swarm 3.14 test-results-analyzer 0.3.5 timestamper 1.8.10 token-macro 2.5 uno-choice 2.1 variant 1.1 windows-slaves 1.3.1 workflow-aggregator 2.6 workflow-api 2.29 workflow-basic-steps 2.11 workflow-cps 2.57 workflow-cps-global-lib 2.12 workflow-durable-task-step 2.22 workflow-job 2.25 workflow-multibranch 2.20 workflow-remote-loader 1.4 workflow-scm-step 2.6 workflow-step-api 2.16 workflow-support 2.20 ws-cleanup 0.34 xlrelease-plugin 7.5.1
In standard C-based language (such as Java, Groovy, ...), switch cases ends with break keyword. When there's no statement that break the flow, the next case is executed. For example:
String value = "foo"; switch (value) { case "rab": System.out.println("rab"); case "oof": System.out.println("oof"); break; case "foo": System.out.println("foo"); case "bar": System.out.println("bar"); break; }
It must print "foobar".
However, following pipeline prints: 1, null and 2.
def switchCase(value) { switch (value) { case 'foo': return 1 case 'bar': default: return 2 } } pipeline { agent any options { buildDiscarder(logRotator(numToKeepStr:'5')) disableConcurrentBuilds() timestamps() skipDefaultCheckout() } stages { stage('Switch') { steps { echo "foo -> '${switchCase('foo')}'" echo "bar -> '${switchCase('bar')}'" echo "null -> '${switchCase(null)}'" } } } }
You can check its valid on Groovy through: https://groovyconsole.appspot.com/