title: Java terminates at an if statement, exit value 0
body: <p>I have a program that reads in lines from a file (with two lines) using a while loop (condition is <code>bufferedReader.readLine()!=null</code>), assigns <code>myJSONObject</code> a JSON read from the file, then I have an if statment (<code>if(bufferedReader.readLine()!=null&amp;&amp;!bufferedReader.readline.matches(DELETE_REGEX))</code> and if that's true (i.e. if the line we read is not null, and we don't match a regex) then perform some function on the JSON which should append that new JSON to a file.</p>
  
  <p>I have this in some try-catch blocks. It looks a little like so:</p>
  
  <pre><code>try{
      openFiles;
      while(buff.readLine()!=null){
            try {
                instatiateAndUseJSONParser;
                if(bufferedReader.readLine()!=null
                      &amp;&amp;!bufferedReader.readline.matches(DELETE_REGEX)) 
                {doSomeStuff;}
                else
                {continue;}
            } catch (AllTheExceptions e){e.printStackTrace}
       }
       closeFiles;
  }catch(SomeMoreExceptions e){e.printStackTrace}
  </code></pre>
  
  <p>When I run this is gets to the iff statement, and then terminates with exit value:0 (program closed as normal)</p>
  
  <p>Why is this? It doesn't get anywhere near the 'continue' or a catch block.</p>
  
  <p>If I remove the second line I get a NullPointerException due to line 50 of String Reader, but I'm not using <code>StringReader</code> (I've tried importing it, but eclipse yellow-underlines it and this changes nothing). When debugging, it pops up a tab for <code>StringReader.&lt;init&gt;(String) line: 50</code> and just says 'Source not found'.</p>
  
  <p>I'm pretty new to Java, so I don't really have a clue what's happening. Any help would be appreciated in clearing this up.</p>
  
  <p>Thanks!</p>