diff --git a/src/org/thoughtcrime/securesms/database/CanonicalAddressDatabase.java b/src/org/thoughtcrime/securesms/database/CanonicalAddressDatabase.java index 325d4fed83..423c61abfb 100644 --- a/src/org/thoughtcrime/securesms/database/CanonicalAddressDatabase.java +++ b/src/org/thoughtcrime/securesms/database/CanonicalAddressDatabase.java @@ -28,19 +28,14 @@ import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.util.Log; -import com.google.i18n.phonenumbers.NumberParseException; -import com.google.i18n.phonenumbers.PhoneNumberUtil; -import com.google.i18n.phonenumbers.Phonenumber; -import com.google.i18n.phonenumbers.ShortNumberInfo; - import org.thoughtcrime.securesms.util.GroupUtil; import org.thoughtcrime.securesms.util.LRUCache; import org.thoughtcrime.securesms.util.ShortCodeUtil; import org.thoughtcrime.securesms.util.TextSecurePreferences; -import org.whispersystems.libsignal.util.guava.Optional; import org.whispersystems.signalservice.api.util.InvalidNumberException; import org.whispersystems.signalservice.api.util.PhoneNumberFormatter; +import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -64,9 +59,9 @@ public class CanonicalAddressDatabase { private DatabaseHelper databaseHelper; private final Context context; - private final Map addressCache = new ConcurrentHashMap<>(); - private final Map idCache = new ConcurrentHashMap<>(); - private final LRUCache formattedAddressCache = new LRUCache<>(100); + private final Map addressCache = new ConcurrentHashMap<>(); + private final Map idCache = new ConcurrentHashMap<>(); + private final Map formattedAddressCache = Collections.synchronizedMap(new LRUCache(100)); public synchronized static CanonicalAddressDatabase getInstance(Context context) { if (instance == null)