title: Local variable is redundant JetBrains IDEs (e.g. IntelliJ IDEA)
body: <pre><code>public static double getAmount(){
      Scanner reader = new Scanner(System.in);
      System.out.println("random text");
      double amount;
      return (amount = reader.nextDouble());
  }
  </code></pre>
  
  <p>IntelliJ gives me this warning on the above code:</p>
  
  <blockquote>
    <p>Local variable 'amount' is redundant</p>
  </blockquote>
  
  <p>Why?</p>