title: Difference between Object.var- - and Object.var-=1?
body: <p>Today I encountered a strange warning by my IDE, for one piece of code and no warning for another (supposedly identical) code.
  The following piece of code says the if condition is always false:</p>
  
  <pre><code>public void foo(Node n) {
      assert(n.var &gt; 0);
      n.var--;
      if (n.var == 0) {
           // do stuff
      }
  }
  </code></pre>
  
  <p>While the following works without any warnings:</p>
  
  <pre><code>public void foo(Node n) {
      assert(n.var &gt; 0);
      n.var -= 1;
      if (n.var == 0) {
           // do stuff
      }
  }
  </code></pre>
  
  <p>With the following class:</p>
  
  <pre><code>public class Node {
      private int var;
  }
  </code></pre>
  
  <p>While the first warning is obviously nonsense, I was wondering if there is actually a difference between <code>var--</code> and <code>var-=1</code>..?
  And is this actually a warning specific to my IDE? If not, tell me in the comments and I will edit this post accordingly.</p>