title: Doesn't += return the newly assigned value?
body: <p>I'm looping over image and summing the values of all pixels. I do this to create an integral image. To keep the last value easily available, I created <code>the_sum</code> variable to which I add values for each pixel.</p>
  
  <p>If you know how integral image works, you know that every pixel in such image contains sum of all pixels before <em>plus</em> it's own value.</p>
  
  <p>Hence:</p>
  
  <pre><code>integral_image[x][y][0] = (the_sum[0]+= (pixel &amp; 0x00FF0000)&gt;&gt;16);
  </code></pre>
  
  <p>I increase the sum and assign it to current pixel. Netbeans IDE, however, warns me that I'm not reading from <code>the_sum</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/8l3z6.png" alt="image description"></p>
  
  <p>Something in the algorithm is broken and I'm not sure what is it. Is my approach wrong or is this a false positive report by NetBeans?</p>
  
  <p>To avoid misunderstanding, this is the whole method:</p>
  
  <pre><code>  /* Generate an integral image. Every pixel on such image contains sum of colors or all the
       pixels before and itself.
    */
    public static double[][][] integralImage(BufferedImage image) {
      int w = image.getWidth();
      int h = image.getHeight();
  
      double integral_image[][][] = new double[w][h][3];
      double the_sum[] = new double[3];
  
      for (int x = 0; x &lt; w; x++) {
        for (int y = 0; y &lt; h; y++) {
          int pixel = image.getRGB(x, y);
          integral_image[x][y][0] = (the_sum[0]+= (pixel &amp; 0x00FF0000)&gt;&gt;16);
          integral_image[x][y][1] = (the_sum[1]+= (pixel &amp; 0x0000FF00)&gt;&gt;8);
          integral_image[x][y][2] = (the_sum[2]+=  pixel &amp; 0x000000FF);
        }
      }
  
      return integral_image;
    }
  </code></pre>