Skip to content

Commit

Permalink
Prevent ConcurrentModificationException for cookies map
Browse files Browse the repository at this point in the history
  • Loading branch information
premnirmal committed May 23, 2023
1 parent 9ad41c6 commit 3e4296d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package com.github.premnirmal.ticker.network
import okhttp3.Cookie
import okhttp3.CookieJar
import okhttp3.HttpUrl
import java.util.concurrent.ConcurrentHashMap
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class YahooFinanceCookies @Inject constructor() : CookieJar {

private var _cookies = HashMap<String, Cookie>()
private var _cookies = ConcurrentHashMap<String, Cookie>()

override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>) {
cookies.forEach { cookie ->
Expand Down
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# this file is purely for f-droid because it cannot infer the version name/code from the git tag
versionName=3.9.823
versionCode=300900823
versionName=3.9.824
versionCode=300900824

0 comments on commit 3e4296d

Please sign in to comment.