Gets the value from an entry. Returns null if the entry is invalid, partially-collected, loading, or expired.
(ReferenceEntry<K, V> entry, long now)
| 2830 | */ |
| 2831 | |
| 2832 | V getLiveValue(ReferenceEntry<K, V> entry, long now) { |
| 2833 | if (entry.getKey() == null) { |
| 2834 | tryDrainReferenceQueues(); |
| 2835 | return null; |
| 2836 | } |
| 2837 | V value = entry.getValueReference().get(); |
| 2838 | if (value == null) { |
| 2839 | tryDrainReferenceQueues(); |
| 2840 | return null; |
| 2841 | } |
| 2842 | if (map.isExpired(entry, now)) { |
| 2843 | tryExpireEntries(now); |
| 2844 | return null; |
| 2845 | } |
| 2846 | return value; |
| 2847 | } |
| 2848 | |
| 2849 | @Nullable |
| 2850 | V get(Object key, int hash) { |
no test coverage detected