amaembo / huntbugs

Java bytecode static analyzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FP: Local variable now is never used

ben-manes opened this issue · comments

Local variable now is never used.
This code contains a local variable now which is assigned but never used.
Probably it could be removed.

This variable is used within a lambda expression,

long now = cache.expirationTicker().read();
Consumer<Node<K, V>> consumer = node -> {
  K key = node.getKey();
  V value = node.getValue();
  if ((key != null) && (value != null) && !cache.hasExpired(node, now) && node.isAlive()) {
    action.accept(new WriteThroughEntry<>(cache, key, value));
    advanced[0] = true;
  }
};

This is also a procyon bug, not fixed yet (see procyon#305). Unfortunately procyon development is stalled.