title: Eclipse SonarLint false positive "Unused assignments should be removed (java:S1854)"
body: <p>I'm using Eclipse 2020-03 (4.15.0) with Sonarlint for Eclipse 5.1.0.17086 and I get , IMO, false positive S1854 warnings in the following code (taken from the book "Java 8 In Action"). Working with Java OpenJDK 13.0.2. This is not a showstopper since I am merely studying Java 8 techniques. I just want to understand why these lines are flagged...</p>
  
  <pre><code>package nl.paul.forkjoin;
  
  import java.util.concurrent.RecursiveTask;
  
  public class ForkJoinSumCalculator extends RecursiveTask&lt;Long&gt; {
  private static final long serialVersionUID = 1L;
  
  private final long[] numbers;
  private final int start;
  private final int end;
  
  public static final long THRESHOLD = 10_000;
  
  public ForkJoinSumCalculator(long[] numbers) {
      this(numbers, 0, numbers.length);
  }
  
  private ForkJoinSumCalculator(long[] numbers, int start, int end) {
      this.numbers = numbers;
      this.start = start;
      this.end = end;
  }
  
  @Override
  protected Long compute() {
      int length = end - start; //SonarLint S1854 warning
      if (length &lt;= THRESHOLD) {
          return computeSequentially();
      }
      ForkJoinSumCalculator leftTask = new ForkJoinSumCalculator(numbers, start, start + length / 2); //SonarLint S1854 warning
      ForkJoinSumCalculator rightTask = new ForkJoinSumCalculator(numbers, start + length / 2, end); //SonarLint S1854 warning
      leftTask.fork();
      return leftTask.join() + rightTask.compute();
  }
  
  private long computeSequentially() {
      long sum = 0;
      for (int i = start; i &lt; end; i++) {
          sum += numbers[i];
      }
      return sum;
  }
  }
  </code></pre>
  
  <p>Did I miss something here? Both "length", "leftTask" and "rightTask" are used several times in the code...</p>
  
  <p>Above class is tested with the following class:</p>
  
  <pre class="lang-java prettyprint-override"><code>package nl.paul.forkjoin;
  
  import java.util.concurrent.ForkJoinPool;
  import java.util.concurrent.ForkJoinTask;
  import java.util.stream.LongStream;
  
  public class ForkJoinTest {
  
      public static void main(String[] args) {
          System.out.println(new ForkJoinTest().doIt(10_000_000));
      }
  
      private long doIt(long n) {
          long[] numbers = LongStream.rangeClosed(0, n).toArray();
          long start = System.currentTimeMillis();
          ForkJoinTask&lt;Long&gt; task = new ForkJoinSumCalculator(numbers);
          long result = new ForkJoinPool().invoke(task);
          long finish = System.currentTimeMillis();
          System.out.println("Processing took " + (finish - start) + " msec.");
          return result;
      }
  }
  </code></pre>