Skip to content

Commit

Permalink
Merge branch 'private-release/v1.1.0-223' into private-release/v1.1.0…
Browse files Browse the repository at this point in the history
…-231
  • Loading branch information
Dzianis Lisiankou authored and Dzianis Lisiankou committed Aug 18, 2023
2 parents 74fb063 + 51d3e08 commit 9a41573
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/eu/ibagroup/formainframe/api/ZosmfApiImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ class ZosmfApiImpl : ZosmfApi {
useBytesConverter: Boolean
): Api {
val zosmfUrl = ZosmfUrl(url, isAllowSelfSigned)
val defaultApi = Pair<MutableMap<ZosmfUrl, Any>, MutableMap<ZosmfUrl, Any>>(hashMapOf(), hashMapOf())
if (!apis.containsKey(apiClass)) {
synchronized(apis) {
if (!apis.containsKey(apiClass)) {
apis[apiClass] = Pair(hashMapOf(), hashMapOf())
apis[apiClass] = defaultApi
}
}
}
val apiClassMap = apis[apiClass]!!
val apiClassMap = apis[apiClass] ?: defaultApi
synchronized(apiClassMap) {
if (!useBytesConverter && !apiClassMap.first.containsKey(zosmfUrl)) {
apiClassMap.first[zosmfUrl] = buildApi(zosmfUrl.url, getOkHttpClient(zosmfUrl.isAllowSelfSigned), apiClass)
Expand All @@ -94,7 +95,6 @@ class ZosmfApiImpl : ZosmfApi {
}
return if (!useBytesConverter) apiClassMap.first[zosmfUrl] as Api else apiClassMap.second[zosmfUrl] as Api
}

}

private val gsonFactory = GsonConverterFactory.create(GsonBuilder().create())
Expand Down

0 comments on commit 9a41573

Please sign in to comment.