title: Return statement returns half-right. (half-solved, possibly a bug?)
body: <pre><code>//finds the exactNode, where node.data = target
  private Node findExact(int target) {
      Node init = head;
  
      if(init == null) {
          return null;
      }
  
      int index = 0;
      int size = getSize();
      while((index &lt; size) &amp;&amp; (init.data != target)) {
          init = init.next;
          index++;
  
          //returns null if called from main method. However does not
          //return null out of main method (within other methods in the same class)
          if ((index == size - 1) &amp;&amp; (init.data != target)) { 
              return null;
          }
      }
  
      //this if block is needed somehow, to actually return null if findExact() is
      //used in other methods in the same class.
      if(init == null) {
          return null;
      }
  
      return init;
  }
  </code></pre>
  
  <p>About an hour ago:
  Without the last if-block, calling the method from the main method  returns null, however it returns the address of last init in the while loop.</p>
  
  <p>Now:
  It works fine without the last if-block, I have 0 clue why.<br>
  Can someone elaborate on this? Whether if I was trying to solve something<br>
  that never happened, or if it's a bug?<br>
  If it is a bug, then how to prevent it?</p>