private void checkFillModeOff(boolean fillMode, int index) {
    if (fillMode) {
      throw new IllegalArgumentException("Bad date/time conversion pattern: " + pattern +
          ". Error at index " + index + ": Fill mode modifier (FM) must "
          + "be followed by a temporal token.");
    }
  }
Parse pattern to list of tokens.
common/src/java/org/apache/hadoop/hive/common/format/datetime/HiveSqlDateTimeFormatter.java