ben-manes / caffeine

Possible null access JAVA-E1083
Bug risk
Critical
36 occurrences in this check
 862        return false;
 863      }
 864      V cachedValue = cache.get(key);
 865      return (cachedValue != null) && cachedValue.equals(value); 866    }
 867
 868    @Override
129    if ((buffers == null)
130        || ((mask = buffers.length - 1) < 0)
131        || ((buffer = buffers[h & mask]) == null)
132        || !(uncontended = ((result = buffer.offer(e)) != Buffer.FAILED))) {133      return expandOrRetry(e, h, increment, uncontended);
134    }
135    return result;
129    if ((buffers == null)
130        || ((mask = buffers.length - 1) < 0)
131        || ((buffer = buffers[h & mask]) == null)
132        || !(uncontended = ((result = buffer.offer(e)) != Buffer.FAILED))) {133      return expandOrRetry(e, h, increment, uncontended);
134    }
135    return result;
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
238        var result = (prior == null) ? future : prior;
239        result.whenComplete((r, e) -> asyncCache.cache().refreshes().remove(keyReference, result));
240        return result;
241      } else if (!oldValueFuture.isDone()) {242        // no-op if load is pending
243        return oldValueFuture;
244      }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
238        var result = (prior == null) ? future : prior;
239        result.whenComplete((r, e) -> asyncCache.cache().refreshes().remove(keyReference, result));
240        return result;
241      } else if (!oldValueFuture.isDone()) {242        // no-op if load is pending
243        return oldValueFuture;
244      }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
238        var result = (prior == null) ? future : prior;
239        result.whenComplete((r, e) -> asyncCache.cache().refreshes().remove(keyReference, result));
240        return result;
241      } else if (!oldValueFuture.isDone()) {242        // no-op if load is pending
243        return oldValueFuture;
244      }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
238        var result = (prior == null) ? future : prior;
239        result.whenComplete((r, e) -> asyncCache.cache().refreshes().remove(keyReference, result));
240        return result;
241      } else if (!oldValueFuture.isDone()) {242        // no-op if load is pending
243        return oldValueFuture;
244      }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }
227      // If the entry is absent then perform a new load, else if in-flight then return it
228      var oldValueFuture = asyncCache.cache().getIfPresentQuietly(key);
229      if ((oldValueFuture == null)
230          || (oldValueFuture.isDone() && oldValueFuture.isCompletedExceptionally())) {231        if (oldValueFuture != null) {
232          asyncCache.cache().remove(key, oldValueFuture);
233        }