From 9d09e6bde08389d65066582f20d131c738628dfe Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Thu, 3 Jul 2003 20:56:15 +0000 Subject: [PATCH] checkstyle fixes PR: 21319 Submitted by: Patrick G. Heck (gus dot heck at olin dot edu) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274753 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/unix/AbstractAccessTask.java | 25 ++++++++++++++++--- .../ant/taskdefs/optional/unix/Chgrp.java | 18 ++++++++----- .../ant/taskdefs/optional/unix/Chown.java | 18 ++++++++----- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java index 1ea408a96..1b8b73ccd 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/AbstractAccessTask.java @@ -73,12 +73,14 @@ import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.FileSet; /** - * @author Patrick G. Heck gus.heck@olin.edu + * @author Patrick G. Heck + * gus.heck@olin.edu * @since Ant 1.6 * * @ant.task category="filesystem" */ -public abstract class AbstractAccessTask + +public abstract class AbstractAccessTask extends org.apache.tools.ant.taskdefs.ExecuteOn { /** @@ -89,6 +91,9 @@ public abstract class AbstractAccessTask super.setSkipEmptyFilesets(true); } + /** + * Set the file which should have its access attributes modified. + */ public void setFile(File src) { FileSet fs = new FileSet(); fs.setFile(src); @@ -96,16 +101,22 @@ public abstract class AbstractAccessTask } /** + * Prevent the user from specifying a different command. + * * @ant.attribute ignore="true" + * @param cmdl A user supplied command line that we won't accept. */ public void setCommand(Commandline cmdl) { - throw new BuildException(taskType + - " doesn\'t support the command attribute", + throw new BuildException(taskType + + " doesn\'t support the command attribute", getLocation()); } /** + * Prevent the skipping of empty filesets + * * @ant.attribute ignore="true" + * @param skip A user supplied boolean we won't accept. */ public void setSkipEmptyFilesets(boolean skip) { throw new BuildException(taskType + " doesn\'t support the " @@ -114,13 +125,19 @@ public abstract class AbstractAccessTask } /** + * Prevent the use of the addsourcefile atribute. + * * @ant.attribute ignore="true" + * @param b A user supplied boolean we won't accept. */ public void setAddsourcefile(boolean b) { throw new BuildException(getTaskType() + " doesn\'t support the addsourcefile attribute", getLocation()); } + /** + * Automatically approve Unix OS's. + */ protected boolean isValidOs() { return Os.isFamily("unix") && super.isValidOs(); } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chgrp.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chgrp.java index 616345632..7c6c9944c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chgrp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chgrp.java @@ -70,7 +70,7 @@ import org.apache.tools.ant.BuildException; /** * Chgrp equivalent for unix-like environments. * - * @author Patrick G. Heck + * @author Patrick G. Heck * gus.heck@olin.edu * * @since Ant 1.6 @@ -98,20 +98,26 @@ public class Chgrp extends AbstractAccessTask { haveGroup = true; } + /** + * Ensure that all the required arguments and other conditions have + * been set. + */ protected void checkConfiguration() { if (!haveGroup) { - throw new BuildException("Required attribute group not set in "+ - "chgrp", getLocation()); + throw new BuildException("Required attribute group not set in " + + "chgrp", getLocation()); } super.checkConfiguration(); } /** * We don't want to expose the executable atribute, so overide it. + * + * @param e User supplied executable that we won't accept. */ public void setExecutable(String e) { - throw new BuildException(taskType + - " doesn\'t support the executable attribute", - getLocation()); + throw new BuildException(taskType + + " doesn\'t support the executable" + + " attribute", getLocation()); } } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chown.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chown.java index eda0b08ca..cc951f98f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chown.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Chown.java @@ -70,7 +70,7 @@ import org.apache.tools.ant.BuildException; /** * Chown equivalent for unix-like environments. * - * @author Patrick G. Heck + * @author Patrick G. Heck * gus.heck@olin.edu * * @since Ant 1.6 @@ -98,20 +98,26 @@ public class Chown extends AbstractAccessTask { haveOwner = true; } + /** + * Ensure that all the required arguments and other conditions have + * been set. + */ protected void checkConfiguration() { if (!haveOwner) { - throw new BuildException("Required attribute owner not set in" + - " chown", getLocation()); + throw new BuildException("Required attribute owner not set in" + + " chown", getLocation()); } super.checkConfiguration(); } /** * We don't want to expose the executable atribute, so overide it. + * + * @param e User supplied executable that we won't accept. */ public void setExecutable(String e) { - throw new BuildException(taskType + - " doesn\'t support the executable attribute", - getLocation()); + throw new BuildException(taskType + + " doesn\'t support the executable" + + " attribute", getLocation()); } }