You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2004/12/06 18:53:09 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/cvslib CvsTagEntry.java

peterreilly    2004/12/06 09:53:09

  Modified:    src/main/org/apache/tools/ant/taskdefs/cvslib
                        CvsTagEntry.java
  Log:
  Some general style changes, javadoc comments, removed c++ style variable names
  Obtained from: Kevin Jackson
  
  Revision  Changes    Path
  1.8       +61 -24    ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java
  
  Index: CvsTagEntry.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CvsTagEntry.java	22 Nov 2004 09:23:31 -0000	1.7
  +++ CvsTagEntry.java	6 Dec 2004 17:53:09 -0000	1.8
  @@ -19,52 +19,89 @@
   /**
    * Holds the information of a line of rdiff
    */
  -class CvsTagEntry {
  -    String m_filename;
  -    String m_prevRevision;
  -    String m_revision;
  +public class CvsTagEntry {
   
  -    public CvsTagEntry(String filename) {
  +    /** the filename */
  +    private String filename;
  +
  +    /** the previous revision */
  +    private String prevRevision;
  +
  +    /** the revision */
  +    private String revision;
  +
  +    /**
  +     * Creates a new CvsTagEntry
  +     * @param filename the filename to add
  +     */
  +    public CvsTagEntry(final String filename) {
           this(filename, null, null);
       }
   
  -    public CvsTagEntry(String filename, String revision) {
  +    /**
  +     * Creates a new CvsTagEntry
  +     * @param filename the filename to add
  +     * @param revision the revision
  +     */
  +    public CvsTagEntry(final String filename, final String revision) {
           this(filename, revision, null);
       }
   
  -    public CvsTagEntry(String filename, String revision,
  -                       String prevRevision) {
  -        m_filename = filename;
  -        m_revision = revision;
  -        m_prevRevision = prevRevision;
  -    }
  -
  +    /**
  +     * Creates a new CvsTagEntry
  +     * @param filename the filename to add
  +     * @param revision the revision
  +     * @param prevRevision the previous revision
  +     */
  +    public CvsTagEntry(final String filename, final String revision,
  +                       final String prevRevision) {
  +        this.filename = filename;
  +        this.revision = revision;
  +        this.prevRevision = prevRevision;
  +    }
  +
  +    /**
  +     * Gets the filename for this CvsTagEntry
  +     * @return the filename
  +     */
       public String getFile() {
  -        return m_filename;
  +        return filename;
       }
   
  +    /**
  +     * Gets the revision for this CvsTagEntry
  +     * @return the revision
  +     */
       public String getRevision() {
  -        return m_revision;
  +        return revision;
       }
   
  +    /**
  +     * Gets the previous revision for this CvsTagEntry
  +     * @return the previous revision
  +     */
       public String getPreviousRevision() {
  -        return m_prevRevision;
  +        return prevRevision;
       }
   
  +    /**
  +     * Gets a String containing filename and difference from previous version
  +     * @return a string representation of this CVSTagEntry
  +     */
       public String toString() {
           StringBuffer buffer = new StringBuffer();
  -        buffer.append(m_filename);
  -        if ((m_revision == null)) {
  +        buffer.append(filename);
  +        if ((revision == null)) {
               buffer.append(" was removed");
  -            if (m_prevRevision != null) {
  -                buffer.append("; previous revision was ").append(m_prevRevision);
  +            if (prevRevision != null) {
  +                buffer.append("; previous revision was ").append(prevRevision);
               }
  -        } else if (m_revision != null && m_prevRevision == null) {
  +        } else if (revision != null && prevRevision == null) {
               buffer.append(" is new; current revision is ")
  -                .append(m_revision);
  -        } else if (m_revision != null && m_prevRevision != null) {
  +                .append(revision);
  +        } else if (revision != null && prevRevision != null) {
               buffer.append(" has changed from ")
  -                .append(m_prevRevision).append(" to ").append(m_revision);
  +                .append(prevRevision).append(" to ").append(revision);
           }
           return buffer.toString();
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org