title: SimpleDateFormat ambiguous matching
body: <p>I have the code:</p>
  
  <pre><code>public List&lt;Date&gt; parse(String date) {
          // todo: for parsing
          List&lt;Date&gt; dateList = new ArrayList&lt;&gt;();
          SimpleDateFormat sdf = new SimpleDateFormat();
          sdf.setLenient(true);
          for (String format: DATE_FORMATS) {
              sdf = new SimpleDateFormat(format);
              try {
                  Date dt = sdf.parse(date);
                  System.out.println("Success! "+format);
                  dateList.add(dt);
              } catch (ParseException e) {
                  // TODO Auto-generated catch block
                  //System.err.println("failed!");
              }
          }
          return dateList;
      }
  </code></pre>
  
  <p>which is called:</p>
  
  <pre><code>parse("Monday Aug 29 5:51 PM GMT 2016")
  </code></pre>
  
  <p>I am getting the results:</p>
  
  <pre><code>Success! EEEE MMM dd hh:mm a z yyyy
  Success! EEEE MMM yyyy hh:mm a z dd
  </code></pre>
  
  <p>Why does the second pattern match the example? Any enlightenment would be highly appreciated.</p>
  
  <p>Thanks</p>