fix serialization issue

This commit is contained in:
Jim Nicholson 2024-02-08 23:40:30 -08:00
parent 188e6f1ab3
commit 6992c88fb9
2 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,9 @@
},
"NoDef": {
"enabled": false
},
"UnnecessaryGetter": {
"enabled": false
}
}
}

View File

@ -38,7 +38,7 @@ Map call(Map config = [:], Map queryParams = [:]) {
body = response.content
assets = readJSON text: body
if (assets.items && !assets.items.empty) {
if (assets.items && !assets.items.isEmpty()) {
latest = assets.items.last()
/* We have to use instanceof here. The value SHOULD be null, but it comes back
as class rather than null. This is probably a bug in the Pipeline Utilities
@ -46,7 +46,7 @@ Map call(Map config = [:], Map queryParams = [:]) {
/* groovylint-disable-next-line Instanceof */
if (latest.version instanceof net.sf.json.JSONNull && latest.name) {
echo 'Search result version field was null, looking in name field for a version'
match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.-].*)/)
java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.-].*)/)
if (!match) {
echo "Match: ${match}"
error("Regular expression match failed for latest.name: ${latest.name}")