From 1954bcf0f55640bb4a0b74749fbe3cbe5db8b41e Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Sat, 18 Nov 2006 18:00:30 +0000 Subject: [PATCH] checkstyle git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@476571 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/jsp/Jasper41Mangler.java | 1 + .../taskdefs/optional/jsp/JspNameMangler.java | 7 +++++- .../ant/taskdefs/optional/jsp/WLJspc.java | 23 +++++++++++++++---- .../compilers/DefaultJspCompilerAdapter.java | 4 ++++ .../optional/jsp/compilers/JasperC.java | 3 +++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java index 38dcd122f..fce93d9b0 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java @@ -81,6 +81,7 @@ public class Jasper41Mangler implements JspMangler { /** * taking in the substring representing the path relative to the source dir * return a new string representing the destination path + * @param path not used. * @return null as this is not implemented. * @todo */ diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java index 5d69adce5..100a314d3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java @@ -26,6 +26,8 @@ import java.io.File; */ public class JspNameMangler implements JspMangler { + // CheckStyle:ConstantNameCheck OFF - bc + /** * this is the list of keywords which can not be used as classnames */ @@ -46,6 +48,7 @@ public class JspNameMangler implements JspMangler { "try", "void", "volatile", "while" }; + // CheckStyle:ConstantNameCheck ON /** * map from a jsp file to a java filename; does not do packages @@ -123,7 +126,7 @@ public class JspNameMangler implements JspMangler { * @param ch char to mangle * @return mangled string; 5 digit hex value */ - private static final String mangleChar(char ch) { + private static String mangleChar(char ch) { if (ch == File.separatorChar) { ch = '/'; @@ -146,6 +149,8 @@ public class JspNameMangler implements JspMangler { * taking in the substring representing the path relative to the source dir * return a new string representing the destination path * not supported, as jasper in tomcat4.0 doesnt either + * @param path not used + * @return null always. */ public String mapPath(String path) { return null; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java index af9ae8d44..fdd1d939b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java @@ -99,6 +99,10 @@ public class WLJspc extends MatchingTask { private String pathToPackage = ""; private Vector filesToDo = new Vector(); + /** + * Run the task. + * @throws BuildException if there is an error. + */ public void execute() throws BuildException { if (!destinationDirectory.isDirectory()) { throw new BuildException("destination directory " @@ -196,7 +200,7 @@ public class WLJspc extends MatchingTask { /** * Set the classpath to be used for this compilation. - * + * @param classpath the classpath to use. */ public void setClasspath(Path classpath) { if (compileClasspath == null) { @@ -208,6 +212,7 @@ public class WLJspc extends MatchingTask { /** * Maybe creates a nested classpath element. + * @return a path to be configured. */ public Path createClasspath() { if (compileClasspath == null) { @@ -248,9 +253,12 @@ public class WLJspc extends MatchingTask { destinationPackage = packageName; } - - - protected void scanDir(String files[]) { + /** + * Scan the array of files and add the jsp + * files that need to be compiled to the filesToDo field. + * @param files the files to scan. + */ + protected void scanDir(String[] files) { long now = (new Date()).getTime(); File jspFile = null; @@ -297,6 +305,13 @@ public class WLJspc extends MatchingTask { } + /** + * Replace occurances of a string with a replacement string. + * @param inpString the string to convert. + * @param escapeChars the string to replace. + * @param replaceChars the string to place. + * @return the converted string. + */ protected String replaceString(String inpString, String escapeChars, String replaceChars) { String localString = ""; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java index ebb5566eb..35f8c6c22 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java @@ -69,11 +69,15 @@ public abstract class DefaultJspCompilerAdapter jspc.log(niceSourceList.toString(), Project.MSG_VERBOSE); } + // CheckStyle:VisibilityModifier OFF - bc + /** * our owner */ protected JspC owner; + // CheckStyle:VisibilityModifier ON + /** * set the owner * @param owner the owner JspC compiler diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java index db4e00e4a..b6f8c58d6 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java @@ -36,12 +36,15 @@ import org.apache.tools.ant.types.Path; */ public class JasperC extends DefaultJspCompilerAdapter { + // CheckStyle:VisibilityModifier OFF - bc /** * what produces java classes from .jsp files */ JspMangler mangler; + // CheckStyle:VisibilityModifier ON + /** * Constructor for JasperC. * @param mangler a filename converter