Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274953 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 22 years ago
parent
commit
777590134d
5 changed files with 26 additions and 11 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Concat.java
  2. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/ConditionTask.java
  3. +11
    -1
      src/main/org/apache/tools/ant/taskdefs/Copydir.java
  4. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java
  5. +7
    -3
      src/main/org/apache/tools/ant/taskdefs/XmlProperty.java

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Concat.java View File

@@ -101,7 +101,7 @@ import org.apache.tools.ant.util.FileUtils;
* @author Peter Reilly * @author Peter Reilly
*/ */
public class Concat extends Task { public class Concat extends Task {
// The size of buffers to be used // The size of buffers to be used
private static final int BUFFER_SIZE = 8192; private static final int BUFFER_SIZE = 8192;




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

@@ -1,7 +1,7 @@
/* /*
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved. * reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -83,7 +83,7 @@ public class ConditionTask extends ConditionBase {


/** /**
* The name of the property to set. Required. * The name of the property to set. Required.
*
* @param p the name of the property
* @since Ant 1.4 * @since Ant 1.4
*/ */
public void setProperty(String p) { public void setProperty(String p) {
@@ -93,7 +93,7 @@ public class ConditionTask extends ConditionBase {
/** /**
* The value for the property to set, if condition evaluates to true. * The value for the property to set, if condition evaluates to true.
* Defaults to "true". * Defaults to "true".
*
* @param v the value of the property
* @since Ant 1.4 * @since Ant 1.4
*/ */
public void setValue(String v) { public void setValue(String v) {
@@ -104,6 +104,7 @@ public class ConditionTask extends ConditionBase {
* See whether our nested condition holds and set the property. * See whether our nested condition holds and set the property.
* *
* @since Ant 1.4 * @since Ant 1.4
* @exception BuildException if an error occurs
*/ */
public void execute() throws BuildException { public void execute() throws BuildException {
if (countConditions() > 1) { if (countConditions() > 1) {


+ 11
- 1
src/main/org/apache/tools/ant/taskdefs/Copydir.java View File

@@ -1,7 +1,7 @@
/* /*
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights
* reserved. * reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -81,10 +81,20 @@ public class Copydir extends MatchingTask {
private boolean forceOverwrite = false; private boolean forceOverwrite = false;
private Hashtable filecopyList = new Hashtable(); private Hashtable filecopyList = new Hashtable();


/**
* The src attribute
*
* @param src the source file
*/
public void setSrc(File src) { public void setSrc(File src) {
srcDir = src; srcDir = src;
} }


/**
* The dest attribute
*
* @param dest the destination file
*/
public void setDest(File dest) { public void setDest(File dest) {
destDir = dest; destDir = dest;
} }


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java View File

@@ -83,12 +83,12 @@ public class DefaultExcludes extends Task {
* @exception BuildException if someting goes wrong with the build * @exception BuildException if someting goes wrong with the build
*/ */
public void execute() throws BuildException { public void execute() throws BuildException {
if (defaultrequested == false && add.equals("") && remove.equals("") && (echo == false)) {
if (!defaultrequested && add.equals("") && remove.equals("") && !echo) {
throw new BuildException("<defaultexcludes> task must set " throw new BuildException("<defaultexcludes> task must set "
+ "at least one attribute (echo=\"false\"" + "at least one attribute (echo=\"false\""
+ " doesn't count since that is the default"); + " doesn't count since that is the default");
} }
if (defaultrequested == true) {
if (defaultrequested) {
DirectoryScanner.resetDefaultExcludes(); DirectoryScanner.resetDefaultExcludes();
} }
if (!add.equals("")) { if (!add.equals("")) {
@@ -97,7 +97,7 @@ public class DefaultExcludes extends Task {
if (!remove.equals("")) { if (!remove.equals("")) {
DirectoryScanner.removeDefaultExclude(remove); DirectoryScanner.removeDefaultExclude(remove);
} }
if (echo == true) {
if (echo) {
StringBuffer message StringBuffer message
= new StringBuffer("Current Default Excludes:\n"); = new StringBuffer("Current Default Excludes:\n");
String[] excludes = DirectoryScanner.getDefaultExcludes(); String[] excludes = DirectoryScanner.getDefaultExcludes();


+ 7
- 3
src/main/org/apache/tools/ant/taskdefs/XmlProperty.java View File

@@ -54,9 +54,7 @@


package org.apache.tools.ant.taskdefs; package org.apache.tools.ant.taskdefs;


import java.io.BufferedInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Hashtable; import java.util.Hashtable;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
@@ -296,8 +294,9 @@ public class XmlProperty extends org.apache.tools.ant.Task {
} catch (SAXException sxe) { } catch (SAXException sxe) {
// Error generated during parsing // Error generated during parsing
Exception x = sxe; Exception x = sxe;
if (sxe.getException() != null)
if (sxe.getException() != null) {
x = sxe.getException(); x = sxe.getException();
}
throw new BuildException(x); throw new BuildException(x);


} catch (ParserConfigurationException pce) { } catch (ParserConfigurationException pce) {
@@ -572,6 +571,7 @@ public class XmlProperty extends org.apache.tools.ant.Task {


/** /**
* The XML file to parse; required. * The XML file to parse; required.
* @param src the file to parse
*/ */
public void setFile(File src) { public void setFile(File src) {
this.src = src; this.src = src;
@@ -579,6 +579,7 @@ public class XmlProperty extends org.apache.tools.ant.Task {


/** /**
* the prefix to prepend to each property * the prefix to prepend to each property
* @param prefix the prefix to prepend to each property
*/ */
public void setPrefix(String prefix) { public void setPrefix(String prefix) {
this.prefix = prefix.trim(); this.prefix = prefix.trim();
@@ -588,6 +589,7 @@ public class XmlProperty extends org.apache.tools.ant.Task {
* flag to include the xml root tag as a * flag to include the xml root tag as a
* first value in the property name; optional, * first value in the property name; optional,
* default is true * default is true
* @param keepRoot if true (default), include the xml root tag
*/ */
public void setKeeproot(boolean keepRoot) { public void setKeeproot(boolean keepRoot) {
this.keepRoot = keepRoot; this.keepRoot = keepRoot;
@@ -595,6 +597,7 @@ public class XmlProperty extends org.apache.tools.ant.Task {


/** /**
* flag to validate the XML file; optional, default false * flag to validate the XML file; optional, default false
* @param validate if true validate the XML file, default false
*/ */
public void setValidate(boolean validate) { public void setValidate(boolean validate) {
this.validate = validate; this.validate = validate;
@@ -603,6 +606,7 @@ public class XmlProperty extends org.apache.tools.ant.Task {
/** /**
* flag to treat attributes as nested elements; * flag to treat attributes as nested elements;
* optional, default false * optional, default false
* @param collapseAttributes if true treat attributes as nested elements
*/ */
public void setCollapseAttributes(boolean collapseAttributes) { public void setCollapseAttributes(boolean collapseAttributes) {
this.collapseAttributes = collapseAttributes; this.collapseAttributes = collapseAttributes;


Loading…
Cancel
Save