Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@579712 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
5c861cf9e6
8 changed files with 25 additions and 9 deletions
  1. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  2. +1
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
  3. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
  4. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  5. +9
    -6
      src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
  6. +4
    -0
      src/main/org/apache/tools/ant/util/DOMElementWriter.java
  7. +2
    -1
      src/main/org/apache/tools/ant/util/UUEncoder.java
  8. +2
    -1
      src/main/org/apache/tools/ant/util/depend/bcel/DependencyVisitor.java

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

@@ -706,6 +706,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
* see if it needs to be rebuilt.
* @return true if the jar needs to be rebuilt.
*/
// CheckStyle:MethodLength OFF - this will no be fixed
protected boolean isRebuildRequired(File genericJarFile, File weblogicJarFile) {
boolean rebuild = false;



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

@@ -676,6 +676,7 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool {
* see if it needs to be rebuilt.
* @return true if a rebuild is required.
*/
// CheckStyle:MethodLength OFF - this will no be fixed
protected boolean isRebuildRequired(File genericJarFile, File websphereJarFile) {
boolean rebuild = false;



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

@@ -36,6 +36,7 @@ import org.apache.tools.ant.taskdefs.Java;
*/
public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool
implements HotDeploymentTool {
private static final int STRING_BUFFER_SIZE = 1024;
/** The classname of the tool to run **/
private static final String WEBLOGIC_DEPLOY_CLASS_NAME = "weblogic.deploy";

@@ -161,7 +162,7 @@ public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool
ServerDeploy task = getTask();
// constructs the "-url <url> -debug <action> <password>" portion
// of the commmand line
return new StringBuffer(1024)
return new StringBuffer(STRING_BUFFER_SIZE)
.append((getServer() != null)
? "-url " + getServer()
: "")


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

@@ -141,7 +141,9 @@ public class WLJspc extends MatchingTask {
helperTask.setFork(true);
helperTask.setClassname("weblogic.jspc");
helperTask.setTaskName(getTaskName());
// CheckStyle:MagicNumber OFF
String[] args = new String[12];
// CheckStyle:MagicNumber ON

File jspFile = null;
String parents = "";
@@ -185,9 +187,11 @@ public class WLJspc extends MatchingTask {
args[j + 2] = sourceDirectory + File.separator + filename;
helperTask.clearArgs();

// CheckStyle:MagicNumber OFF
for (int x = 0; x < j + 3; x++) {
helperTask.createArg().setValue(args[x]);
}
// CheckStyle:MagicNumber ON

helperTask.setClasspath(compileClasspath);
if (helperTask.executeJava() != 0) {


+ 9
- 6
src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java View File

@@ -145,6 +145,9 @@ import org.apache.tools.ant.util.ResourceUtils;
public class ModifiedSelector extends BaseExtendSelector
implements BuildListener, ResourceSelector {

private static final String CACHE_START = "cache.";
private static final String ALGORITHM_START = "algorithm.";
private static final String COMPARATOR_START = "comparator.";

// ----- attributes -----

@@ -747,14 +750,14 @@ public class ModifiedSelector extends BaseExtendSelector
? true
: false;
setSeldirs(sdValue);
} else if (key.startsWith("cache.")) {
String name = key.substring(6);
} else if (key.startsWith(CACHE_START)) {
String name = key.substring(CACHE_START.length());
tryToSetAParameter(cache, name, value);
} else if (key.startsWith("algorithm.")) {
String name = key.substring(10);
} else if (key.startsWith(ALGORITHM_START)) {
String name = key.substring(ALGORITHM_START.length());
tryToSetAParameter(algorithm, name, value);
} else if (key.startsWith("comparator.")) {
String name = key.substring(11);
} else if (key.startsWith(COMPARATOR_START)) {
String name = key.substring(COMPARATOR_START.length());
tryToSetAParameter(comparator, name, value);
} else {
setError("Invalid parameter " + key);


+ 4
- 0
src/main/org/apache/tools/ant/util/DOMElementWriter.java View File

@@ -477,8 +477,10 @@ public class DOMElementWriter {
int cdEnd = result.indexOf("]]>");
while (cdEnd != -1) {
sb.setLength(cdEnd);
// CheckStyle:MagicNumber OFF
sb.append("&#x5d;&#x5d;&gt;")
.append(result.substring(cdEnd + 3));
// CheckStyle:MagicNumber ON
result = sb.substring(0);
cdEnd = result.indexOf("]]>");
}
@@ -499,7 +501,9 @@ public class DOMElementWriter {
if (ent.charAt(1) == '#') {
if (ent.charAt(2) == 'x') {
try {
// CheckStyle:MagicNumber OFF
Integer.parseInt(ent.substring(3, ent.length() - 1), HEX);
// CheckStyle:MagicNumber ON
return true;
} catch (NumberFormatException nfe) {
return false;


+ 2
- 1
src/main/org/apache/tools/ant/util/UUEncoder.java View File

@@ -33,6 +33,7 @@ import java.io.PrintStream;
public class UUEncoder {
protected static final int DEFAULT_MODE = 644;
private static final int MAX_CHARS_PER_LINE = 45;
private static final int INPUT_BUFFER_SIZE = MAX_CHARS_PER_LINE * 100;
private OutputStream out;
private String name;

@@ -60,7 +61,7 @@ public class UUEncoder {
throws IOException {
this.out = out;
encodeBegin();
byte[] buffer = new byte[MAX_CHARS_PER_LINE * 100];
byte[] buffer = new byte[INPUT_BUFFER_SIZE];
int count;
while ((count = is.read(buffer, 0, buffer.length)) != -1) {
int pos = 0;


+ 2
- 1
src/main/org/apache/tools/ant/util/depend/bcel/DependencyVisitor.java View File

@@ -87,7 +87,8 @@ public class DependencyVisitor extends EmptyVisitor {
String name = obj.getName(constantPool);
if (obj.getSignature(constantPool).equals("Ljava/lang/Class;")
&& name.startsWith("class$")) {
String classname = name.substring(6).replace('$', '.');
String classname
= name.substring("class$".length()).replace('$', '.');
// does the class have a package structure
int index = classname.lastIndexOf(".");
if (index > 0) {


Loading…
Cancel
Save