title: DateTimeFormatter parsing string with optional time part fails if space removed
body: <p>Following <a href="https://stackoverflow.com/questions/49323017/parse-date-only-as-localdatetime-in-java-8/">my other question on how to parse date-only strings as LocalDateTime</a>, on attempt to parse string 20120301122133 using pattern yyyyMMdd[HHmmss] I get an error. Strange thing is that parsing 20120301 122133 using pattern yyyyMMdd[ HHmmss] works perfectly.</p>
  
  <p>So this code works fine</p>
  
  <pre><code>LocalDateTime.parse(
       "19940513 230000", 
       new DateTimeFormatterBuilder()
          .appendPattern("yyyyMMdd[ HHmmss]")
          .parseDefaulting(ChronoField.HOUR_OF_DAY, 0)
          .parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)   
          .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
          .toFormatter()
  )
  </code></pre>
  
  <p>And this one fails</p>
  
  <pre><code>LocalDateTime.parse(
      "19940513230000", 
      new DateTimeFormatterBuilder()
          .appendPattern("yyyyMMdd[HHmmss]")
          .parseDefaulting(ChronoField.HOUR_OF_DAY, 0) 
          .parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)         
          .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
          .toFormatter()
  )
  </code></pre>
  
  <p>How should I parse Strings in format yyyyMMdd[HHmmss], i.e. in format yyyyMMddHHmmss with optional time part using the java 8 time API?</p>
  
  <p>The parse pattern is a configurable option and thus is known only at runtime. So I can't e.g. replace the String pattern with hard-coded DateTimeFormatterBuilder invocations.</p>