Skip to content

Commit

Permalink
Merge branch 'private-release/v1.1.0-221' into zowe-release/v1.1.0-221
Browse files Browse the repository at this point in the history
  • Loading branch information
KUGDev committed Aug 22, 2023
2 parents 8af2e38 + c9e5d8e commit e82fe77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/org/zowe/explorer/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 e82fe77

Please sign in to comment.