title: Make SimpleDateFormat.parse() fail on invalid dates (e.g. month is greater than 12)
body: <p>I'm using <code>java.text.SimpleDateFormat</code> to parse strings of the form <code>"yyyyMMdd"</code>.</p>
  
  <p>If I try to parse a string with a month greater than 12, instead of failing, it rolls over to the next year. Full runnable repro:</p>
  
  <pre><code>import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  public class ParseDateTest {
  
      public static void main(String[] args) throws ParseException {
  
          SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
          Date result = format.parse("20091504"); // &lt;- should not be a valid date!
          System.out.println(result); // prints Thu Mar 04 00:00:00 CST 2010
      }
   }
  </code></pre>
  
  <p>I would rather have a <code>ParseException</code> thrown.</p>
  
  <p>Is there any non-hacky way of forcing the exception to happen?. I mean, I don't want to manually check if the month is greater than 12. That's kind of ridiculous.</p>
  
  <p>Thanks for any suggestion.</p>
  
  <p>NOTE: I already know about Joda Time, but I need this done in plain JDK without external libraries.</p>