Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@476571 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
1954bcf0f5
5 changed files with 33 additions and 5 deletions
  1. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/Jasper41Mangler.java
  2. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java
  3. +19
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  4. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
  5. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java

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

@@ -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
* @param path not used.
* @return null as this is not implemented. * @return null as this is not implemented.
* @todo * @todo
*/ */


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

@@ -26,6 +26,8 @@ import java.io.File;
*/ */
public class JspNameMangler implements JspMangler { public class JspNameMangler implements JspMangler {


// CheckStyle:ConstantNameCheck OFF - bc

/** /**
* this is the list of keywords which can not be used as classnames * 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" "try", "void", "volatile", "while"
}; };


// CheckStyle:ConstantNameCheck ON


/** /**
* map from a jsp file to a java filename; does not do packages * 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 * @param ch char to mangle
* @return mangled string; 5 digit hex value * @return mangled string; 5 digit hex value
*/ */
private static final String mangleChar(char ch) {
private static String mangleChar(char ch) {


if (ch == File.separatorChar) { if (ch == File.separatorChar) {
ch = '/'; ch = '/';
@@ -146,6 +149,8 @@ public class JspNameMangler 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
* not supported, as jasper in tomcat4.0 doesnt either * not supported, as jasper in tomcat4.0 doesnt either
* @param path not used
* @return null always.
*/ */
public String mapPath(String path) { public String mapPath(String path) {
return null; return null;


+ 19
- 4
src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java View File

@@ -99,6 +99,10 @@ public class WLJspc extends MatchingTask {
private String pathToPackage = ""; private String pathToPackage = "";
private Vector filesToDo = new Vector(); private Vector filesToDo = new Vector();


/**
* Run the task.
* @throws BuildException if there is an error.
*/
public void execute() throws BuildException { public void execute() throws BuildException {
if (!destinationDirectory.isDirectory()) { if (!destinationDirectory.isDirectory()) {
throw new BuildException("destination directory " throw new BuildException("destination directory "
@@ -196,7 +200,7 @@ public class WLJspc extends MatchingTask {


/** /**
* Set the classpath to be used for this compilation. * Set the classpath to be used for this compilation.
*
* @param classpath the classpath to use.
*/ */
public void setClasspath(Path classpath) { public void setClasspath(Path classpath) {
if (compileClasspath == null) { if (compileClasspath == null) {
@@ -208,6 +212,7 @@ public class WLJspc extends MatchingTask {


/** /**
* Maybe creates a nested classpath element. * Maybe creates a nested classpath element.
* @return a path to be configured.
*/ */
public Path createClasspath() { public Path createClasspath() {
if (compileClasspath == null) { if (compileClasspath == null) {
@@ -248,9 +253,12 @@ public class WLJspc extends MatchingTask {
destinationPackage = packageName; 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(); long now = (new Date()).getTime();
File jspFile = null; 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, protected String replaceString(String inpString, String escapeChars,
String replaceChars) { String replaceChars) {
String localString = ""; String localString = "";


+ 4
- 0
src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java View File

@@ -69,11 +69,15 @@ public abstract class DefaultJspCompilerAdapter
jspc.log(niceSourceList.toString(), Project.MSG_VERBOSE); jspc.log(niceSourceList.toString(), Project.MSG_VERBOSE);
} }


// CheckStyle:VisibilityModifier OFF - bc

/** /**
* our owner * our owner
*/ */
protected JspC owner; protected JspC owner;


// CheckStyle:VisibilityModifier ON

/** /**
* set the owner * set the owner
* @param owner the owner JspC compiler * @param owner the owner JspC compiler


+ 3
- 0
src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java View File

@@ -36,12 +36,15 @@ import org.apache.tools.ant.types.Path;
*/ */
public class JasperC extends DefaultJspCompilerAdapter { public class JasperC extends DefaultJspCompilerAdapter {


// CheckStyle:VisibilityModifier OFF - bc


/** /**
* what produces java classes from .jsp files * what produces java classes from .jsp files
*/ */
JspMangler mangler; JspMangler mangler;


// CheckStyle:VisibilityModifier ON

/** /**
* Constructor for JasperC. * Constructor for JasperC.
* @param mangler a filename converter * @param mangler a filename converter


Loading…
Cancel
Save