fix serialization issue
This commit is contained in:
parent
188e6f1ab3
commit
6992c88fb9
@ -18,6 +18,9 @@
|
||||
},
|
||||
"NoDef": {
|
||||
"enabled": false
|
||||
},
|
||||
"UnnecessaryGetter": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user