MCPcopy Create free account
hub / github.com/antlr/codebuff / getIfPresent

Method getIfPresent

corpus/java/training/guava/cache/LocalCache.java:4031–4041  ·  view source on GitHub ↗
(Object key)

Source from the content-addressed store, hash-verified

4029 }
4030
4031 @Nullable
4032 public V getIfPresent(Object key) {
4033 int hash = hash(checkNotNull(key));
4034 V value = segmentFor(hash).get(key, hash);
4035 if (value == null) {
4036 globalStatsCounter.recordMisses(1);
4037 } else {
4038 globalStatsCounter.recordHits(1);
4039 }
4040 return value;
4041 }
4042
4043 // Only becomes available in Java 8 when it's on the interface.
4044 // @Override

Callers

nothing calls this directly

Calls 6

hashMethod · 0.95
segmentForMethod · 0.95
getMethod · 0.65
recordMissesMethod · 0.65
recordHitsMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected