diff options
author | Stephane Bailliez <sbailliez@apache.org> | 2002-01-09 00:03:22 +0000 |
---|---|---|
committer | Stephane Bailliez <sbailliez@apache.org> | 2002-01-09 00:03:22 +0000 |
commit | 244252d7c9ed28035af96f36dad07288ad111ead (patch) | |
tree | 1627448a0df2e96e2a3dccac919679d3116c3e0d /src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java | |
parent | 8ad08b239266a6c19ea3e3bd63b94b23d0bea58f (diff) | |
download | ant-244252d7c9ed28035af96f36dad07288ad111ead.tar.gz |
Code layout only.
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270644 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java')
-rw-r--r-- | src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java b/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java index f20c92e37..094584aac 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java @@ -66,13 +66,13 @@ import org.apache.tools.ant.Project; * to the output stream for the project (by setting the "name" * attribute only), to set a property based on the value of * a counter (by setting the "property" attribute) or to set the counter - * on the perforce server (by setting the "value" attribute). + * on the perforce server (by setting the "value" attribute). * * Example Usage:<br> * <p4counter name="${p4.counter}" property=${p4.change}"/> * @author <a href="mailto:kirk@radik.com">Kirk Wylie</a> */ - + public class P4Counter extends P4Base { public String counter = null; public String property = null; @@ -96,35 +96,35 @@ public class P4Counter extends P4Base { public void execute() throws BuildException { - if((counter == null) || counter.length() == 0) { + if ((counter == null) || counter.length() == 0) { throw new BuildException("No counter specified to retrieve"); } - if(shouldSetValue && shouldSetProperty) { + if (shouldSetValue && shouldSetProperty) { throw new BuildException("Cannot both set the value of the property and retrieve the value of the property."); } String command = "counter " + P4CmdOpts + " " + counter; - if(!shouldSetProperty) { + if (!shouldSetProperty) { // NOTE kirk@radik.com 04-April-2001 -- If you put in the -s, you // have to start running through regular expressions here. Much easier // to just not include the scripting information than to try to add it // and strip it later. command = "-s " + command; } - if(shouldSetValue) { + if (shouldSetValue) { command += " " + value; } - if(shouldSetProperty) { + if (shouldSetProperty) { final Project myProj = project; P4Handler handler = new P4HandlerAdapter() { public void process(String line) { - log("P4Counter retrieved line \""+ line + "\"", Project.MSG_VERBOSE); + log("P4Counter retrieved line \"" + line + "\"", Project.MSG_VERBOSE); try { value = Integer.parseInt(line); - myProj.setProperty(property, ""+value); + myProj.setProperty(property, "" + value); } catch (NumberFormatException nfe) { throw new BuildException("Perforce error. Could not retrieve counter value."); } |