@Test public void empty_access_by_e164() { RecipientId recipientId = recipientIdCache.get(null, "+155512345"); assertNull(recipientId); }
synchronized @Nullable RecipientId get(@Nullable UUID uuid, @Nullable String e164) { if (uuid != null && e164 != null) { RecipientId recipientIdByUuid = ids.get(uuid); if (recipientIdByUuid == null) return null; RecipientId recipientIdByE164 = ids.get(e164); if (recipientIdByE164 == null) return null; if (recipientIdByUuid.equals(recipientIdByE164)) { return recipientIdByUuid; } else { ids.remove(uuid); ids.remove(e164); Log.w(TAG, "Seen invalid RecipientIdCacheState"); return null; } } else if (uuid != null) { return ids.get(uuid); } else if (e164 != null) { return ids.get(e164); } return null; }
RecipientIdCache { synchronized @Nullable RecipientId get(@Nullable UUID uuid, @Nullable String e164) { if (uuid != null && e164 != null) { RecipientId recipientIdByUuid = ids.get(uuid); if (recipientIdByUuid == null) return null; RecipientId recipientIdByE164 = ids.get(e164); if (recipientIdByE164 == null) return null; if (recipientIdByUuid.equals(recipientIdByE164)) { return recipientIdByUuid; } else { ids.remove(uuid); ids.remove(e164); Log.w(TAG, "Seen invalid RecipientIdCacheState"); return null; } } else if (uuid != null) { return ids.get(uuid); } else if (e164 != null) { return ids.get(e164); } return null; } }
RecipientIdCache { synchronized @Nullable RecipientId get(@Nullable UUID uuid, @Nullable String e164) { if (uuid != null && e164 != null) { RecipientId recipientIdByUuid = ids.get(uuid); if (recipientIdByUuid == null) return null; RecipientId recipientIdByE164 = ids.get(e164); if (recipientIdByE164 == null) return null; if (recipientIdByUuid.equals(recipientIdByE164)) { return recipientIdByUuid; } else { ids.remove(uuid); ids.remove(e164); Log.w(TAG, "Seen invalid RecipientIdCacheState"); return null; } } else if (uuid != null) { return ids.get(uuid); } else if (e164 != null) { return ids.get(e164); } return null; } RecipientIdCache(int limit); }
RecipientIdCache { synchronized @Nullable RecipientId get(@Nullable UUID uuid, @Nullable String e164) { if (uuid != null && e164 != null) { RecipientId recipientIdByUuid = ids.get(uuid); if (recipientIdByUuid == null) return null; RecipientId recipientIdByE164 = ids.get(e164); if (recipientIdByE164 == null) return null; if (recipientIdByUuid.equals(recipientIdByE164)) { return recipientIdByUuid; } else { ids.remove(uuid); ids.remove(e164); Log.w(TAG, "Seen invalid RecipientIdCacheState"); return null; } } else if (uuid != null) { return ids.get(uuid); } else if (e164 != null) { return ids.get(e164); } return null; } RecipientIdCache(int limit);  }
RecipientIdCache { synchronized @Nullable RecipientId get(@Nullable UUID uuid, @Nullable String e164) { if (uuid != null && e164 != null) { RecipientId recipientIdByUuid = ids.get(uuid); if (recipientIdByUuid == null) return null; RecipientId recipientIdByE164 = ids.get(e164); if (recipientIdByE164 == null) return null; if (recipientIdByUuid.equals(recipientIdByE164)) { return recipientIdByUuid; } else { ids.remove(uuid); ids.remove(e164); Log.w(TAG, "Seen invalid RecipientIdCacheState"); return null; } } else if (uuid != null) { return ids.get(uuid); } else if (e164 != null) { return ids.get(e164); } return null; } RecipientIdCache(int limit);   }