Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@473560 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 19 years ago
parent
commit
bba53939c8
11 changed files with 54 additions and 22 deletions
  1. +24
    -19
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
  2. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Change.java
  3. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java
  4. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Delete.java
  5. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java
  6. +5
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4HandlerAdapter.java
  7. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java
  8. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Labelsync.java
  9. +7
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java
  10. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java
  11. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/perforce/SimpleP4OutputHandler.java

+ 24
- 19
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java View File

@@ -42,7 +42,8 @@ import org.apache.tools.ant.types.Commandline;
* @see org.apache.tools.ant.taskdefs.Execute
*/
public abstract class P4Base extends org.apache.tools.ant.Task {

// CheckStyle:VisibilityModifier OFF - bc
// CheckStyle:MemberNameCheck OFF - bc
/**Perl5 regexp in Java - cool eh? */
protected Perl5Util util = null;
/** The OS shell to use (cmd.exe or /bin/sh) */
@@ -76,6 +77,10 @@ public abstract class P4Base extends org.apache.tools.ant.Task {

/** If inError is set, then errorMessage needs to contain the reason why. */
private String errorMessage = "";

// CheckStyle:MemberNameCheck ON
// CheckStyle:VisibilityModifier ON

/**
* gets whether or not the task has encountered an error
* @return error flag
@@ -115,39 +120,39 @@ public abstract class P4Base extends org.apache.tools.ant.Task {
* The p4d server and port to connect to;
* optional, default "perforce:1666"
*
* @param P4Port the port one wants to set such as localhost:1666
* @param p4Port the port one wants to set such as localhost:1666
*/
public void setPort(String P4Port) {
this.P4Port = "-p" + P4Port;
public void setPort(String p4Port) {
this.P4Port = "-p" + p4Port;
}

/**
* The p4 client spec to use;
* optional, defaults to the current user
*
* @param P4Client the name of the Perforce client spec
* @param p4Client the name of the Perforce client spec
*/
public void setClient(String P4Client) {
this.P4Client = "-c" + P4Client;
public void setClient(String p4Client) {
this.P4Client = "-c" + p4Client;
}

/**
* The p4 username;
* optional, defaults to the current user
*
* @param P4User the user name
* @param p4User the user name
*/
public void setUser(String P4User) {
this.P4User = "-u" + P4User;
public void setUser(String p4User) {
this.P4User = "-u" + p4User;
}
/**
* Set global P4 options; Used on all
* of the Perforce tasks.
*
* @param P4Opts global options, to use a specific P4Config file for instance
* @param p4Opts global options, to use a specific P4Config file for instance
*/
public void setGlobalopts(String P4Opts) {
this.P4Opts = P4Opts;
public void setGlobalopts(String p4Opts) {
this.P4Opts = p4Opts;
}
/**
* The client, branch or label view to operate upon;
@@ -161,21 +166,21 @@ public abstract class P4Base extends org.apache.tools.ant.Task {
* <li>p4resolve</li>
* </ul>
*
* @param P4View the view one wants to use
* @param p4View the view one wants to use
*/
public void setView(String P4View) {
this.P4View = P4View;
public void setView(String p4View) {
this.P4View = p4View;
}

/**
* Set extra command options; only used on some
* of the Perforce tasks.
*
* @param P4CmdOpts command line options going after the particular
* @param p4CmdOpts command line options going after the particular
* Perforce command
*/
public void setCmdopts(String P4CmdOpts) {
this.P4CmdOpts = P4CmdOpts;
public void setCmdopts(String p4CmdOpts) {
this.P4CmdOpts = p4CmdOpts;
}

/**


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Change.java View File

@@ -39,9 +39,11 @@ import org.apache.tools.ant.Project;
* @ant.task category="scm"
*/
public class P4Change extends P4Base {
// CheckStyle:VisibilityModifier OFF - bc

protected String emptyChangeList = null;
protected String description = "AutoSubmit By Ant";
// CheckStyle:VisibilityModifier ON

/**
* creates a new Perforce change list


+ 3
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java View File

@@ -49,6 +49,7 @@ import org.apache.tools.ant.Project;
*/

public class P4Counter extends P4Base {
// CheckStyle:VisibilityModifier OFF - bc
/**
* name of the counter
*/
@@ -70,6 +71,8 @@ public class P4Counter extends P4Base {
*/
public int value = 0;

// CheckStyle:VisibilityModifier ON

/**
* The name of the counter; required
* @param counter name of the counter


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Delete.java View File

@@ -33,10 +33,12 @@ import org.apache.tools.ant.BuildException;
*/
public class P4Delete extends P4Base {

// CheckStyle:VisibilityModifier OFF - bc
/**
* number of the change list to work on
*/
public String change = null;
// CheckStyle:VisibilityModifier ON

/**
* An existing changelist number for the deletion; optional


+ 3
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java View File

@@ -40,11 +40,14 @@ import org.apache.tools.ant.BuildException;

public class P4Edit extends P4Base {

// CheckStyle:VisibilityModifier OFF - bc
/**
* number of the change list to work on
*/
public String change = null;

// CheckStyle:VisibilityModifier ON

/**
* An existing changelist number to assign files to; optional
* but strongly recommended.


+ 5
- 2
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4HandlerAdapter.java View File

@@ -30,9 +30,10 @@ import org.apache.tools.ant.taskdefs.PumpStreamHandler;
* command line client
*/
public abstract class P4HandlerAdapter implements P4Handler {
// CheckStyle:VisibilityModifier OFF - bc
String p4input = "";
private PumpStreamHandler myHandler = null;
// CheckStyle:VisibilityModifier ON
/**
* set any data to be written to P4's stdin
* @param p4Input the text to write to P4's stdin
@@ -50,7 +51,7 @@ public abstract class P4HandlerAdapter implements P4Handler {
/**
* this routine gets called by the execute routine of the Execute class
* it connects the PumpStreamHandler to the input/output/error streams of the process.
* @throws BuildException
* @throws BuildException if there is a error.
* @see org.apache.tools.ant.taskdefs.Execute#execute
*/
public void start() throws BuildException {
@@ -75,9 +76,11 @@ public abstract class P4HandlerAdapter implements P4Handler {
myHandler.stop();
}

// CheckStyle:VisibilityModifier OFF - bc
OutputStream os; //Input
InputStream is; //Output
InputStream es; //Error
// CheckStyle:VisibilityModifier ON

/**
* connects the handler to the input stream into Perforce


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java View File

@@ -44,9 +44,11 @@ import org.apache.tools.ant.util.StringUtils;
*/
public class P4Label extends P4Base {

// CheckStyle:VisibilityModifier OFF - bc
protected String name;
protected String desc;
protected String lock;
// CheckStyle:VisibilityModifier ON

/**
* The name of the label; optional, default "AntLabel"


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Labelsync.java View File

@@ -42,10 +42,12 @@ import org.apache.tools.ant.util.StringUtils;
*/
public class P4Labelsync extends P4Base {

// CheckStyle:VisibilityModifier OFF - bc
protected String name;
private boolean add; /* -a */
private boolean delete; /* -n */
private boolean simulationmode; /* -n */
// CheckStyle:VisibilityModifier ON
/**
* -a flag of p4 labelsync - preserve files which exist in the label,
* but not in the current view


+ 7
- 1
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java View File

@@ -40,11 +40,13 @@ import java.util.Vector;
*/
public class P4Submit extends P4Base {

// CheckStyle:VisibilityModifier OFF - bc
//ToDo: If dealing with default cl need to parse out <enter description here>
/**
* change list number
*/
public String change;
// CheckStyle:VisibilityModifier ON
/**
* change property
*/
@@ -96,6 +98,10 @@ public class P4Submit extends P4Base {
* internal class used to process the output of p4 submit
*/
public class P4SubmitAdapter extends SimpleP4OutputHandler {
/**
* Constructor.
* @param parent a P4Base instance.
*/
public P4SubmitAdapter(P4Base parent) {
super(parent);
}
@@ -114,7 +120,7 @@ public class P4Submit extends P4Base {
util.split(myarray, line);
boolean found = false;
for (int counter = 0; counter < myarray.size(); counter++) {
if (found == true) {
if (found) {
String chnum = (String) myarray.elementAt(counter + 1);
int changenumber = Integer.parseInt(chnum);
log("Perforce change renamed " + changenumber, Project.MSG_INFO);


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java View File

@@ -50,8 +50,10 @@ import org.apache.tools.ant.Project;
*/
public class P4Sync extends P4Base {

// CheckStyle:VisibilityModifier OFF - bc
String label;
private String syncCmd = "";
// CheckStyle:VisibilityModifier ON

/**
* Label to sync client to; optional.


+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/optional/perforce/SimpleP4OutputHandler.java View File

@@ -33,7 +33,9 @@ import org.apache.tools.ant.util.StringUtils;
*/
public class SimpleP4OutputHandler extends P4HandlerAdapter {

// CheckStyle:VisibilityModifier OFF - bc
P4Base parent;
// CheckStyle:VisibilityModifier ON

/**
* simple constructor


Loading…
Cancel
Save