Browse Source

Some general style changes, javadoc comments, removed c++ style variable names

Obtained from: Kevin Jackson


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277128 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
ab752d0295
2 changed files with 72 additions and 35 deletions
  1. +59
    -22
      src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java
  2. +13
    -13
      src/main/org/apache/tools/ant/taskdefs/cvslib/CvsUser.java

+ 59
- 22
src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java View File

@@ -19,52 +19,89 @@ package org.apache.tools.ant.taskdefs.cvslib;
/**
* 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();
}


+ 13
- 13
src/main/org/apache/tools/ant/taskdefs/cvslib/CvsUser.java View File

@@ -25,9 +25,9 @@ import org.apache.tools.ant.BuildException;
*/
public class CvsUser {
/** The user's Id */
private String m_userID;
private String userID;
/** The user's full name */
private String m_displayName;
private String displayName;


/**
@@ -36,7 +36,7 @@ public class CvsUser {
* @param displayName the user's full name
*/
public void setDisplayname(final String displayName) {
m_displayName = displayName;
this.displayName = displayName;
}


@@ -46,7 +46,7 @@ public class CvsUser {
* @param userID the user's new id value.
*/
public void setUserid(final String userID) {
m_userID = userID;
this.userID = userID;
}


@@ -55,8 +55,8 @@ public class CvsUser {
*
* @return The userID value
*/
String getUserID() {
return m_userID;
public String getUserID() {
return userID;
}


@@ -65,26 +65,26 @@ public class CvsUser {
*
* @return the user's full name
*/
String getDisplayname() {
return m_displayName;
public String getDisplayname() {
return displayName;
}


/**
* validate that this object is configured.
* Validate that this object is configured.
*
* @exception BuildException if the instance has not be correctly
* configured.
*/
void validate() throws BuildException {
if (null == m_userID) {
public void validate() throws BuildException {
if (null == userID) {
final String message = "Username attribute must be set.";

throw new BuildException(message);
}
if (null == m_displayName) {
if (null == displayName) {
final String message =
"Displayname attribute must be set for userID " + m_userID;
"Displayname attribute must be set for userID " + userID;

throw new BuildException(message);
}


Loading…
Cancel
Save