Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@475986 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
36012960a9
27 changed files with 146 additions and 48 deletions
  1. +11
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
  2. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java
  3. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
  4. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCheck.java
  5. +8
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
  6. +7
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
  7. +4
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  8. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/JSharp.java
  9. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  10. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java
  11. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/extension/Extension.java
  12. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionAdapter.java
  13. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java
  14. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
  15. +8
    -8
      src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
  16. +3
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
  17. +5
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapter.java
  18. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java
  19. +5
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/javah/Kaffeh.java
  20. +4
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java
  21. +7
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java
  22. +5
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
  23. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java
  24. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  25. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspMangler.java
  26. +37
    -10
      src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  27. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/pvcs/PvcsProject.java

+ 11
- 0
src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java View File

@@ -214,6 +214,7 @@ public class Rpm extends Task {
/** /**
* What command to issue to the rpm build tool; optional. * What command to issue to the rpm build tool; optional.
* The default is "-bb" * The default is "-bb"
* @param c the command to use.
*/ */
public void setCommand(String c) { public void setCommand(String c) {
this.command = c; this.command = c;
@@ -221,6 +222,7 @@ public class Rpm extends Task {


/** /**
* The name of the spec File to use; required. * The name of the spec File to use; required.
* @param sf the spec file name to use.
*/ */
public void setSpecFile(String sf) { public void setSpecFile(String sf) {
if ((sf == null) || (sf.trim().equals(""))) { if ((sf == null) || (sf.trim().equals(""))) {
@@ -232,6 +234,7 @@ public class Rpm extends Task {
/** /**
* Flag (optional, default=false) to remove * Flag (optional, default=false) to remove
* the generated files in the BUILD directory * the generated files in the BUILD directory
* @param cbd a <code>boolean</code> value.
*/ */
public void setCleanBuildDir(boolean cbd) { public void setCleanBuildDir(boolean cbd) {
cleanBuildDir = cbd; cleanBuildDir = cbd;
@@ -239,6 +242,7 @@ public class Rpm extends Task {


/** /**
* Flag (optional, default=false) to remove the spec file from SPECS * Flag (optional, default=false) to remove the spec file from SPECS
* @param rs a <code>boolean</code> value.
*/ */
public void setRemoveSpec(boolean rs) { public void setRemoveSpec(boolean rs) {
removeSpec = rs; removeSpec = rs;
@@ -248,6 +252,7 @@ public class Rpm extends Task {
* Flag (optional, default=false) * Flag (optional, default=false)
* to remove the sources after the build. * to remove the sources after the build.
* See the <tt>--rmsource</tt> option of rpmbuild. * See the <tt>--rmsource</tt> option of rpmbuild.
* @param rs a <code>boolean</code> value.
*/ */
public void setRemoveSource(boolean rs) { public void setRemoveSource(boolean rs) {
removeSource = rs; removeSource = rs;
@@ -255,6 +260,7 @@ public class Rpm extends Task {


/** /**
* Optional file to save stdout to. * Optional file to save stdout to.
* @param output the file to save stdout to.
*/ */
public void setOutput(File output) { public void setOutput(File output) {
this.output = output; this.output = output;
@@ -262,6 +268,7 @@ public class Rpm extends Task {


/** /**
* Optional file to save stderr to * Optional file to save stderr to
* @param error the file to save error output to.
*/ */
public void setError(File error) { public void setError(File error) {
this.error = error; this.error = error;
@@ -338,6 +345,10 @@ public class Rpm extends Task {
} }


/** /**
* Get the execute object.
* @param toExecute the command line to use.
* @param streamhandler the stream handler to use.
* @return the execute object.
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
protected Execute getExecute(Commandline toExecute, protected Execute getExecute(Commandline toExecute,


+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java View File

@@ -34,10 +34,14 @@ import org.apache.tools.ant.taskdefs.Java;
* This task is considered unsupported by the Ant developers * This task is considered unsupported by the Ant developers
*/ */
public class StyleBook extends Java { public class StyleBook extends Java {
// CheckStyle:VisibilityModifier OFF - bc
// CheckStyle:MemberNameCheck OFF - bc
protected File m_targetDirectory; protected File m_targetDirectory;
protected File m_skinDirectory; protected File m_skinDirectory;
protected String m_loaderConfig; protected String m_loaderConfig;
protected File m_book; protected File m_book;
// CheckStyle:MemberNameCheck ON
// CheckStyle:VisibilityModifier ON




/** /**
@@ -81,7 +85,7 @@ public class StyleBook extends Java {


/** /**
* A loader configuration to send to stylebook; optional. * A loader configuration to send to stylebook; optional.
* @param loaderConfig
* @param loaderConfig the configuration to use.
*/ */
public void setLoaderConfig(final String loaderConfig) { public void setLoaderConfig(final String loaderConfig) {
m_loaderConfig = loaderConfig; m_loaderConfig = loaderConfig;
@@ -90,6 +94,7 @@ public class StyleBook extends Java {


/** /**
* call the program * call the program
* @throws BuildException if there is a problem.
*/ */
public void execute() public void execute()
throws BuildException { throws BuildException {


+ 6
- 2
src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java View File

@@ -215,7 +215,9 @@ public class XMLValidateTask extends Task {
* Add an attribute nested element. This is used for setting arbitrary * Add an attribute nested element. This is used for setting arbitrary
* features of the SAX parser. * features of the SAX parser.
* Valid attributes * Valid attributes
* <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description">include</a>
* <a href=
* "http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"
* >include</a>
* @return attribute created * @return attribute created
* @since ant1.6 * @since ant1.6
*/ */
@@ -653,7 +655,9 @@ public class XMLValidateTask extends Task {
public static class Attribute { public static class Attribute {
/** The name of the attribute to set. /** The name of the attribute to set.
* *
* Valid attributes <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description">include.</a>
* Valid attributes <a href=
* "http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"
* >include.</a>
*/ */
private String attributeName = null; private String attributeName = null;




+ 4
- 0
src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCheck.java View File

@@ -39,8 +39,12 @@ public class CCMCheck extends Continuus {
private String comment = null; private String comment = null;
private String task = null; private String task = null;


// CheckStyle:VisibilityModifier OFF - bc

protected Vector filesets = new Vector(); protected Vector filesets = new Vector();


// CheckStyle:VisibilityModifier ON

/** Constructor for CCMCheck. */ /** Constructor for CCMCheck. */
public CCMCheck() { public CCMCheck() {
super(); super();


+ 8
- 3
src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java View File

@@ -398,12 +398,17 @@ public class Depend extends MatchingTask {
int classMarker = jarFilePath.indexOf('!'); int classMarker = jarFilePath.indexOf('!');
jarFilePath = jarFilePath.substring(0, classMarker); jarFilePath = jarFilePath.substring(0, classMarker);
if (jarFilePath.startsWith("file:")) { if (jarFilePath.startsWith("file:")) {
classpathFileObject = new File(FileUtils.getFileUtils().fromURI(jarFilePath));
classpathFileObject = new File(
FileUtils.getFileUtils().fromURI(jarFilePath));
} else { } else {
throw new IOException("Bizarre nested path in jar: protocol: " + jarFilePath);
throw new IOException(
"Bizarre nested path in jar: protocol: "
+ jarFilePath);
} }
} else if (classURL.getProtocol().equals("file")) { } else if (classURL.getProtocol().equals("file")) {
classpathFileObject = new File(FileUtils.getFileUtils().fromURI(classURL.toExternalForm()));
classpathFileObject = new File(
FileUtils.getFileUtils()
.fromURI(classURL.toExternalForm()));
} }
log("Class " + className log("Class " + className
+ " depends on " + classpathFileObject + " depends on " + classpathFileObject


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

@@ -385,7 +385,13 @@ public class CSharp extends DotnetCompile {
return "cs"; return "cs";
} }


protected void createResourceParameter(NetCommand command, DotnetResource resource) {
/**
* Build a C# style parameter.
* @param command the command.
* @param resource the resource.
*/
protected void createResourceParameter(
NetCommand command, DotnetResource resource) {
resource.getParameters(getProject(), command, true); resource.getParameters(getProject(), command, true);
} }




+ 4
- 6
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java View File

@@ -885,12 +885,10 @@ public abstract class DotnetCompile
} }
} }


/* XXX Javadoc makes little sense, rewrite
* from a resource, get the
* @param command
* @param resource
* @return a string containing the resource param, or a null string
* to conditionally exclude a resource.
/**
* Build a C# style parameter.
* @param command the command.
* @param resource the resource.
*/ */
protected abstract void createResourceParameter(NetCommand command, DotnetResource resource); protected abstract void createResourceParameter(NetCommand command, DotnetResource resource);




+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/JSharp.java View File

@@ -34,8 +34,9 @@ import org.apache.tools.ant.BuildException;
* nested <code>&lt;src&gt;</code> elements instead of the basedir * nested <code>&lt;src&gt;</code> elements instead of the basedir
* attribute if you need more control.</p> * attribute if you need more control.</p>
* *
* @see <A=ref="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vjsharp/html/vjoriMicrosoftVisualJ.asp">
* Visual J++ online documentation</a>
* @see <a ref=
* "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vjsharp/html/vjoriMicrosoftVisualJ.asp"
* >Visual J++ online documentation</a>
* *
* @since ant1.6 * @since ant1.6
* @ant.task category="dotnet" name="jsharpc" * @ant.task category="dotnet" name="jsharpc"
@@ -121,6 +122,7 @@ public class JSharp extends DotnetCompile {
} }
} }


/** {@inheritDoc} */
protected void createResourceParameter(NetCommand command, DotnetResource resource) { protected void createResourceParameter(NetCommand command, DotnetResource resource) {
resource.getParameters(getProject(), command, true); resource.getParameters(getProject(), command, true);
} }


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java View File

@@ -373,8 +373,8 @@ public class NetCommand {


/** /**
* scan through one fileset for files to include * scan through one fileset for files to include
* @param scanner
* @param filesToBuild
* @param scanner the directory scanner to use.
* @param filesToBuild the map to place the files.
* @param outputTimestamp timestamp to compare against * @param outputTimestamp timestamp to compare against
* @return #of files out of date * @return #of files out of date
* @todo should FAT granularity be included here? * @todo should FAT granularity be included here?


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java View File

@@ -347,6 +347,7 @@ public class VisualBasicCompile extends DotnetCompile {
return "vb"; return "vb";
} }


/** {@inheritDoc} */
protected void createResourceParameter(NetCommand command, DotnetResource resource) { protected void createResourceParameter(NetCommand command, DotnetResource resource) {
resource.getParameters(getProject(), command, false); resource.getParameters(getProject(), command, false);
} }


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/extension/Extension.java View File

@@ -619,7 +619,7 @@ public final class Extension {
* @param onToken the token * @param onToken the token
* @return the resultant array * @return the resultant array
*/ */
private static final String[] split(final String string,
private static String[] split(final String string,
final String onToken) { final String onToken) {
final StringTokenizer tokenizer = new StringTokenizer(string, onToken); final StringTokenizer tokenizer = new StringTokenizer(string, onToken);
final String[] result = new String[ tokenizer.countTokens() ]; final String[] result = new String[ tokenizer.countTokens() ];


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

@@ -217,6 +217,8 @@ public class ExtensionAdapter extends DataType {
} }


/** /**
* a debug toString method.
* @return the extension in a string.
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
*/ */
public String toString() { public String toString() {


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java View File

@@ -117,6 +117,7 @@ public class ExtensionSet


/** /**
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
* @return the extensions in a string.
*/ */
public String toString() { public String toString() {
return "ExtensionSet" + Arrays.asList(toExtensions(getProject())); return "ExtensionSet" + Arrays.asList(toExtensions(getProject()));


+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java View File

@@ -123,12 +123,17 @@ public class GenericHotDeploymentTool extends AbstractHotDeploymentTool {
} }


/** /**
*
* get the java attribute.
* @return the java attribute.
*/ */
public Java getJava() { public Java getJava() {
return java; return java;
} }


/**
* Get the classname attribute.
* @return the classname value.
*/
public String getClassName() { public String getClassName() {
return className; return className;
} }


+ 8
- 8
src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java View File

@@ -27,35 +27,35 @@ import org.apache.tools.ant.BuildException;
*/ */
public interface HotDeploymentTool { public interface HotDeploymentTool {
/** The delete action String **/ /** The delete action String **/
public static final String ACTION_DELETE = "delete";
String ACTION_DELETE = "delete";


/** The deploy action String **/ /** The deploy action String **/
public static final String ACTION_DEPLOY = "deploy";
String ACTION_DEPLOY = "deploy";


/** The list action String **/ /** The list action String **/
public static final String ACTION_LIST = "list";
String ACTION_LIST = "list";


/** The undeploy action String **/ /** The undeploy action String **/
public static final String ACTION_UNDEPLOY = "undeploy";
String ACTION_UNDEPLOY = "undeploy";


/** The update action String **/ /** The update action String **/
public static final String ACTION_UPDATE = "update";
String ACTION_UPDATE = "update";


/** /**
* Validates the passed in attributes. * Validates the passed in attributes.
* @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
*/ */
public void validateAttributes() throws BuildException;
void validateAttributes() throws BuildException;


/** /**
* Perform the actual deployment. * Perform the actual deployment.
* @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
*/ */
public void deploy() throws BuildException;
void deploy() throws BuildException;


/** /**
* Sets the parent task. * Sets the parent task.
* @param task A ServerDeploy object representing the parent task. * @param task A ServerDeploy object representing the parent task.
*/ */
public void setTask(ServerDeploy task);
void setTask(ServerDeploy task);
} }

+ 3
- 4
src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java View File

@@ -114,6 +114,7 @@ public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool
* Builds the arguments to pass to weblogic.deploy according to the * Builds the arguments to pass to weblogic.deploy according to the
* supplied action. * supplied action.
* @return A String containing the arguments for the weblogic.deploy tool. * @return A String containing the arguments for the weblogic.deploy tool.
* @throws BuildException if there is an error.
*/ */
public String getArguments() throws BuildException { public String getArguments() throws BuildException {
String action = getTask().getAction(); String action = getTask().getAction();
@@ -121,11 +122,9 @@ public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool


if (action.equals(ACTION_DEPLOY) || action.equals(ACTION_UPDATE)) { if (action.equals(ACTION_DEPLOY) || action.equals(ACTION_UPDATE)) {
args = buildDeployArgs(); args = buildDeployArgs();
}
else if (action.equals(ACTION_DELETE) || action.equals(ACTION_UNDEPLOY)) {
} else if (action.equals(ACTION_DELETE) || action.equals(ACTION_UNDEPLOY)) {
args = buildUndeployArgs(); args = buildUndeployArgs();
}
else if (action.equals(ACTION_LIST)) {
} else if (action.equals(ACTION_LIST)) {
args = buildListArgs(); args = buildListArgs();
} }




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

@@ -13,6 +13,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*
*/ */


package org.apache.tools.ant.taskdefs.optional.javah; package org.apache.tools.ant.taskdefs.optional.javah;
@@ -28,8 +29,10 @@ import org.apache.tools.ant.taskdefs.optional.Javah;
public interface JavahAdapter { public interface JavahAdapter {
/** /**
* Performs the actual compilation. * Performs the actual compilation.
*
* @param javah the calling javah task.
* @return true if the compilation was successful.
* @throws BuildException if there is an error.
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
boolean compile(Javah javah) throws BuildException; boolean compile(Javah javah) throws BuildException;
}
}

+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java View File

@@ -52,6 +52,7 @@ public class JavahAdapterFactory {
* @param log a ProjectComponent instance used to access Ant's * @param log a ProjectComponent instance used to access Ant's
* logging system. * logging system.
* @return The adapter to use. * @return The adapter to use.
* @throws BuildException if there is an error.
*/ */
public static JavahAdapter getAdapter(String choice, public static JavahAdapter getAdapter(String choice,
ProjectComponent log) ProjectComponent log)


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

@@ -31,11 +31,14 @@ import org.apache.tools.ant.util.JavaEnvUtils;
*/ */
public class Kaffeh implements JavahAdapter { public class Kaffeh implements JavahAdapter {


/** the name of the javah adapter - kaffeh */
public static final String IMPLEMENTATION_NAME = "kaffeh"; public static final String IMPLEMENTATION_NAME = "kaffeh";


/** /**
* Performs the actual compilation. * Performs the actual compilation.
*
* @param javah the calling javah task.
* @return true if the compilation was successful.
* @throws BuildException if there is an error.
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
public boolean compile(Javah javah) throws BuildException { public boolean compile(Javah javah) throws BuildException {
@@ -88,4 +91,4 @@ public class Kaffeh implements JavahAdapter {
return cmd; return cmd;
} }


}
}

+ 4
- 1
src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java View File

@@ -34,11 +34,14 @@ import org.apache.tools.ant.types.Path;
*/ */
public class SunJavah implements JavahAdapter { public class SunJavah implements JavahAdapter {


/** the name of the javah adapter - sun */
public static final String IMPLEMENTATION_NAME = "sun"; public static final String IMPLEMENTATION_NAME = "sun";


/** /**
* Performs the actual compilation. * Performs the actual compilation.
*
* @param javah the calling javah task.
* @return true if the compilation was successful.
* @throws BuildException if there is an error.
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
public boolean compile(Javah javah) throws BuildException { public boolean compile(Javah javah) throws BuildException {


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

@@ -29,7 +29,7 @@ import java.io.InputStream;
* strings from a class file. * strings from a class file.
*/ */
class ConstantPool { class ConstantPool {
// CheckStyle:VisibilityModifier OFF - bc
static final static final
byte UTF8 = 1, UNUSED = 2, INTEGER = 3, FLOAT = 4, LONG = 5, DOUBLE = 6, byte UTF8 = 1, UNUSED = 2, INTEGER = 3, FLOAT = 4, LONG = 5, DOUBLE = 6,
CLASS = 7, STRING = 8, FIELDREF = 9, METHODREF = 10, CLASS = 7, STRING = 8, FIELDREF = 9, METHODREF = 10,
@@ -38,7 +38,13 @@ class ConstantPool {
byte[] types; byte[] types;


Object[] values; Object[] values;
// CheckStyle:VisibilityModifier ON


/**
* Create a constant pool.
* @param data the data input containing the class.
* @throws IOException if there is an error.
*/
ConstantPool(DataInput data) throws IOException { ConstantPool(DataInput data) throws IOException {
super(); super();




+ 5
- 0
src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java View File

@@ -37,6 +37,7 @@ import java.util.zip.ZipException;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;


// CheckStyle:TypeNameCheck OFF - bc
/** /**
* jlink links together multiple .jar files. * jlink links together multiple .jar files.
*/ */
@@ -51,8 +52,12 @@ public class jlink {


private boolean compression = false; private boolean compression = false;


// CheckStyle:VisibilityModifier OFF - bc

byte[] buffer = new byte[8192]; byte[] buffer = new byte[8192];


// CheckStyle:VisibilityModifier OFF - bc

/** The file that will be created by this instance of jlink. /** The file that will be created by this instance of jlink.
* @param outfile the file to create. * @param outfile the file to create.
*/ */


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java View File

@@ -62,7 +62,7 @@ public class Jasper41Mangler implements JspMangler {
/** /**
* Mangle the specified character to create a legal Java class name. * Mangle the specified character to create a legal Java class name.
*/ */
private static final String mangleChar(char ch) {
private static String mangleChar(char ch) {


String s = Integer.toHexString(ch); String s = Integer.toHexString(ch);
int nzeros = 5 - s.length(); int nzeros = 5 - s.length();
@@ -81,6 +81,7 @@ public class Jasper41Mangler implements JspMangler {
/** /**
* taking in the substring representing the path relative to the source dir * taking in the substring representing the path relative to the source dir
* return a new string representing the destination path * return a new string representing the destination path
* @return null as this is not implemented.
* @todo * @todo
*/ */
public String mapPath(String path) { public String mapPath(String path) {


+ 1
- 0
src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java View File

@@ -629,6 +629,7 @@ public class JspC extends MatchingTask {
* @param srcFile the source file. * @param srcFile the source file.
* @param srcDir the source directory. * @param srcDir the source directory.
* @param dest the destination directory. * @param dest the destination directory.
* @return the filename.
* @todo support packages and subdirs * @todo support packages and subdirs
*/ */
protected File mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest) { protected File mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest) {


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

@@ -39,6 +39,8 @@ public interface JspMangler {
/** /**
* taking in the substring representing the path relative to the source dir * taking in the substring representing the path relative to the source dir
* return a new string representing the destination path * return a new string representing the destination path
* @param path the path to map.
* @return the mapped path.
*/ */
String mapPath(String path); String mapPath(String path);




+ 37
- 10
src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java View File

@@ -70,6 +70,12 @@ import org.apache.tools.ant.types.Commandline;
* *
*/ */
public class Pvcs extends org.apache.tools.ant.Task { public class Pvcs extends org.apache.tools.ant.Task {
// CheckStyle - magic numbers
// checking for "X:\ 0=dquote,1=letter,2=:,3=\
private static final int POS_1 = 1;
private static final int POS_2 = 2;
private static final int POS_3 = 3;

private String pvcsbin; private String pvcsbin;
private String repository; private String repository;
private String pvcsProject; private String pvcsProject;
@@ -101,6 +107,12 @@ public class Pvcs extends org.apache.tools.ant.Task {
private static final String GET_EXE = "get"; private static final String GET_EXE = "get";




/**
* Run the command.
* @param cmd the command line to use.
* @param out the output stream handler to use.
* @return the exit code of the command.
*/
protected int runCmd(Commandline cmd, ExecuteStreamHandler out) { protected int runCmd(Commandline cmd, ExecuteStreamHandler out) {
try { try {
Project aProj = getProject(); Project aProj = getProject();
@@ -290,12 +302,13 @@ public class Pvcs extends org.apache.tools.ant.Task {
String line = in.readLine(); String line = in.readLine();
while (line != null) { while (line != null) {
log("Considering \"" + line + "\"", Project.MSG_VERBOSE); log("Considering \"" + line + "\"", Project.MSG_VERBOSE);
if (line.startsWith("\"\\")
|| line.startsWith("\"/")
|| (line.length() > 3 && line.startsWith("\"")
&& Character.isLetter(line.charAt(1))
&& String.valueOf(line.charAt(2)).equals(":")
&& String.valueOf(line.charAt(3)).equals("\\"))) {
if (line.startsWith("\"\\") // Checking for "\
|| line.startsWith("\"/") // or "/
// or "X:\...
|| (line.length() > POS_3 && line.startsWith("\"")
&& Character.isLetter(line.charAt(POS_1))
&& String.valueOf(line.charAt(POS_2)).equals(":")
&& String.valueOf(line.charAt(POS_3)).equals("\\"))) {
Object[] objs = mf.parse(line); Object[] objs = mf.parse(line);
String f = (String) objs[1]; String f = (String) objs[1];
// Extract the name of the directory from the filename // Extract the name of the directory from the filename
@@ -337,9 +350,10 @@ public class Pvcs extends org.apache.tools.ant.Task {
/** /**
* Simple hack to handle the PVCS command-line tools botch when * Simple hack to handle the PVCS command-line tools botch when
* handling UNC notation. * handling UNC notation.
* @throws IOException if there is an error.
*/ */
private void massagePCLI(File in, File out) private void massagePCLI(File in, File out)
throws FileNotFoundException, IOException {
throws IOException {
BufferedReader inReader = null; BufferedReader inReader = null;
BufferedWriter outWriter = null; BufferedWriter outWriter = null;
try { try {
@@ -374,6 +388,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
* to parse the output of the pcli command. It defaults to * to parse the output of the pcli command. It defaults to
* <code>{0}-arc({1})</code>. Repositories where the archive * <code>{0}-arc({1})</code>. Repositories where the archive
* extension is not -arc should set this. * extension is not -arc should set this.
* @return the filename format attribute.
*/ */
public String getFilenameFormat() { public String getFilenameFormat() {
return filenameFormat; return filenameFormat;
@@ -385,6 +400,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
* <code>java.text.MessageFormat</code>. * <code>java.text.MessageFormat</code>.
* Index 1 of the format will be used as the file name. * Index 1 of the format will be used as the file name.
* Defaults to <code>{0}-arc({1})</code> * Defaults to <code>{0}-arc({1})</code>
* @param f the format to use.
*/ */
public void setFilenameFormat(String f) { public void setFilenameFormat(String f) {
filenameFormat = f; filenameFormat = f;
@@ -397,6 +413,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
* knows about / and \\, this property is useful in cases where the * knows about / and \\, this property is useful in cases where the
* repository is accessed on a Windows platform via a drive letter * repository is accessed on a Windows platform via a drive letter
* mapping. * mapping.
* @return the lineStart attribute.
*/ */
public String getLineStart() { public String getLineStart() {
return lineStart; return lineStart;
@@ -409,8 +426,8 @@ public class Pvcs extends org.apache.tools.ant.Task {
* drive letter <code>P</code> is incorrect for your setup, you may * drive letter <code>P</code> is incorrect for your setup, you may
* need to change this value, UNC names will always be * need to change this value, UNC names will always be
* accepted. * accepted.
* @param l the value to use.
*/ */

public void setLineStart(String l) { public void setLineStart(String l) {
lineStart = l; lineStart = l;
} }
@@ -575,6 +592,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
/** /**
* If set to true the return value from executing the pvcs * If set to true the return value from executing the pvcs
* commands are ignored; optional, default false. * commands are ignored; optional, default false.
* @param b a <code>boolean</code> value.
*/ */
public void setIgnoreReturnCode(boolean b) { public void setIgnoreReturnCode(boolean b) {
ignorerc = b; ignorerc = b;
@@ -582,12 +600,16 @@ public class Pvcs extends org.apache.tools.ant.Task {


/** /**
* Specify a project within the PVCS repository to extract files from. * Specify a project within the PVCS repository to extract files from.
* @param p
* @param p the pvcs project to use.
*/ */
public void addPvcsproject(PvcsProject p) { public void addPvcsproject(PvcsProject p) {
pvcsProjects.addElement(p); pvcsProjects.addElement(p);
} }


/**
* get the updateOnly attribute.
* @return the updateOnly attribute.
*/
public boolean getUpdateOnly() { public boolean getUpdateOnly() {
return updateOnly; return updateOnly;
} }
@@ -595,6 +617,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
/** /**
* If set to <i>true</i> files are fetched only if * If set to <i>true</i> files are fetched only if
* newer than existing local files; optional, default false. * newer than existing local files; optional, default false.
* @param l a <code>boolean</code> value.
*/ */
public void setUpdateOnly(boolean l) { public void setUpdateOnly(boolean l) {
updateOnly = l; updateOnly = l;
@@ -618,14 +641,18 @@ public class Pvcs extends org.apache.tools.ant.Task {
} }




/**
* Get the userid.
* @return the userid.
*/
public String getUserId() { public String getUserId() {
return userId; return userId;
} }


/** /**
* User ID * User ID
* @param u the value to use.
*/ */

public void setUserId(String u) { public void setUserId(String u) {
userId = u; userId = u;
} }


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

@@ -26,12 +26,14 @@ package org.apache.tools.ant.taskdefs.optional.pvcs;
public class PvcsProject { public class PvcsProject {
private String name; private String name;


/** no arg constructor */
public PvcsProject() { public PvcsProject() {
super(); super();
} }


/** /**
* Set the name of the project * Set the name of the project
* @param name the value to use.
*/ */
public void setName(String name) { public void setName(String name) {
PvcsProject.this.name = name; PvcsProject.this.name = name;
@@ -39,6 +41,7 @@ public class PvcsProject {


/** /**
* Get the name of the project * Get the name of the project
* @return the name of the project.
*/ */
public String getName() { public String getName() {
return name; return name;


Loading…
Cancel
Save