コード例 #1
0
  /** Utility method that saves the current entry. */
  private void saveEntry() {
    final String entryKey = m_date + m_author + m_comment;
    CVSEntry entry;
    if (!m_entries.containsKey(entryKey)) {
      entry = new CVSEntry(parseDate(m_date), m_author, m_comment);
      m_entries.put(entryKey, entry);
    } else {
      entry = m_entries.get(entryKey);
    }

    String branch = findBranch(m_revision);

    owner.log(
        "Recorded a change: "
            + m_date
            + ','
            + m_author
            + ','
            + m_revision
            + "(branch="
            + branch
            + "),"
            + m_comment,
        Project.MSG_VERBOSE);

    entry.addFile(m_file, m_fullName, m_revision, m_previousRevision, branch, m_dead);
  }
コード例 #2
0
  /**
   * Parse date out from expected format.
   *
   * @param date the string holding dat
   * @return the date object or null if unknown date format
   */
  private Date parseDate(String date) {
    for (SimpleDateFormat df : c_inputDate) {
      try {
        return df.parse(date);
      } catch (ParseException e) {
        LOGGER.log(Level.FINER, "Couldn't convert " + date + " to format " + df);
      }
    }

    // nothing worked
    owner.log("Failed to parse " + date + "\n", Project.MSG_ERR);
    // final String message = REZ.getString( "changelog.bat-date.error", date );
    // getContext().error( message );
    return null;
  }