Entry was accessed update expiry if value is non null.
555858
private V returnValue(K key, V _value) {
    if (_value != null) {
      Duration d = expiryPolicy.getExpiryForAccess();
      if (d != null) {
        c2kCache.expireAt(key, calculateExpiry(d));
      }
      return _value;
    }
    return null;
  }
332689
@Override
    public void update(IEntityLock lock, Date newExpiration, Integer newLockType)
            throws LockingException {
        Connection conn = null;
        try {
            conn = RDBMServices.getConnection();
            if (newLockType != null) {
                primDeleteExpired(new Date(), lock.getEntityType(), lock.getEntityKey(), conn);
            }
            primUpdate(lock, newExpiration, newLockType, conn);
        } catch (SQLException sqle) {
            throw new LockingException("Problem updating " + lock, sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }
    }
327944
public void updateIf (T value)
    {
        if (value == null || !value.equals(_value)) {
            update(value);
        }
    }
978663
public void updateOutsideEntry(int spanStart, int spanEnd, double[] values, Factor factor, VariableNumMap var) {
    if (sumProduct) {
      updateEntrySumProduct(outsideChart[spanStart][spanEnd],
          values, factor.coerceToDiscrete().getWeights(), var.getOnlyVariableNum());
    } else {
      updateEntryMaxProduct(outsideChart[spanStart][spanEnd],
          values, factor.coerceToDiscrete().getWeights(), var.getOnlyVariableNum());
    }
  }
694959
def get_active_entry(user, select_for_update=False):
    """"""
    entries = apps.get_model('entries', 'Entry').no_join
    if select_for_update:
        entries = entries.select_for_update()
    entries = entries.filter(user=user, end_time__isnull=True)

    if not entries.exists():
        return None
    if entries.count() > 1:
        raise ActiveEntryError('Only one active entry is allowed.')
    return entries[0]
988710
private void expireAndRemoveEventually(final Entry e) {
    if (isKeepAfterExpired() || e.isProcessing()) {
      metrics.expiredKept();
    } else {

      removeEntry(e);
    }
  }
232144
private void primAdd(IEntityLock lock, Date expiration) throws LockingException {
        long now = System.currentTimeMillis();
        long willExpire = expiration.getTime();
        long cacheIntervalSecs = (willExpire - now) / 1000;

        if (cacheIntervalSecs > 0) {
            SmartCache sc = (SmartCache) getLockCache(lock.getEntityType());

            synchronized (sc) {
                sc.put(getCacheKey(lock), lock, (cacheIntervalSecs));
            }
        }
        // Else the lock has already expired.
    }
1281671
@Override
    public void update(IEntityLock lock, java.util.Date newExpiration, Integer newLockType)
            throws LockingException {
        if (find(lock) == null) {
            throw new LockingException("Problem updating " + lock + " : not found in store.");
        }
        primAdd(lock, newExpiration);
    }
508275
private long calculateExpiryTime(K key, PutOperation<K, V> existing, Operation<K, V> operation, Result<K, V> newValue) {
    if (operation.isExpiryAvailable()) {
      return operation.expirationTime();
    } else {
      try {
        Duration duration;
        if (existing == null) {
          duration = requireNonNull(expiry.getExpiryForCreation(key, newValue.getValue()));
        } else {
          duration = expiry.getExpiryForUpdate(key, existing::getValue, newValue.getValue());
          if (duration == null) {
            return existing.expirationTime();
          }
        }
        if (duration.isNegative()) {
          duration = Duration.ZERO;
        } else if (isExpiryDurationInfinite(duration)) {
          return Long.MAX_VALUE;
        }
        return ExpiryUtils.getExpirationMillis(operation.timeStamp(), duration);
      } catch (Exception ex) {
        LOG.error("Expiry computation caused an exception - Expiry duration will be 0 ", ex);
        return Long.MIN_VALUE;
      }
    }
  }
23958
public static <T> T get (ExpiringReference<T> value)
    {
        return (value == null) ? null : value.getValue();
    }
71551
def _put(self, item: SQLBaseObject):
        """"""
        if item._dto_type in self._expirations and self._expirations[item._dto_type] == 0:
            # The expiration time has been set to 0 -> shoud not be cached
            return
        item.updated()
        self._session().merge(item)
62237
private void updateDefault(final Instance _inst,
                               final String _value)
    {
        try {
            final Update update = new Update(_inst);
            update.add("Default", _value);
            update.execute();
        } catch (final EFapsException e) {
            DBPropertiesUpdate.LOG.error("updateDefault(String, String)", e);
        }
    }
122691
private Object getEntryAfterMiss(TransactionLocal key, int i, Entry e)
    {
        Entry[] tab = table;
        int len = tab.length;

        while (e != null)
        {
            if (e.key == key)
                return e.value;
            i = nextIndex(i, len);
            e = tab[i];
        }
        return null;
    }
817153
public ExpiryPolicyBuilder<K, V> update(Duration update) {
    if (update != null && update.isNegative()) {
      throw new IllegalArgumentException("Update duration must be positive");
    }
    return update((a, b, c) -> update);
  }
283834
public void set(boolean value, int entry) {
        if (entry > numEntries || entry < 0)
            throw new ND4JIllegalStateException(
                            "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")");

        if (oneTime && this.timeTracker.get(entry))
            return;

        if (value)
            this.holder |= 1 << (entry + 1);
        else
            this.holder &= ~(1 << (entry + 1));

        if (oneTime)
            this.timeTracker.set(true, entry);
    }
7489
private void updateValue(Value value) {
    while (true) {
      Value current = currentValue.get();
      if (value.isNewerThan(current)) {
        if (currentValue.compareAndSet(current, value)) {
          if (current == null || !Objects.equals(current.value(), value.value())) {
            eventListeners.forEach(listener -> listener.event(new ValueDelegateEvent<>(ValueDelegateEvent.Type.UPDATE, decode(value.value()))));
          }
          break;
        }
      } else {
        break;
      }
    }
  }
561157
private boolean isExpired(CacheEntry entry) {
        if (ttl == 0) {
            return false;
        }

        return entry.getTimestamp() + ttl < System.currentTimeMillis();
    }