Browse Source

A little bit of checkstyle (thanks Oliver)

Build fiel changes


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271150 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
c87252eaff
6 changed files with 43 additions and 20 deletions
  1. +3
    -2
      proposal/mutant/ant1compat.xml
  2. +1
    -1
      proposal/mutant/build.xml
  3. +0
    -1
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionFrame.java
  4. +33
    -12
      proposal/mutant/src/java/antlibs/system/code/org/apache/ant/antlib/system/AntBase.java
  5. +4
    -3
      proposal/mutant/src/java/common/org/apache/ant/common/antlib/AbstractComponent.java
  6. +2
    -1
      proposal/mutant/src/java/common/org/apache/ant/common/util/AntException.java

+ 3
- 2
proposal/mutant/ant1compat.xml View File

@@ -23,11 +23,9 @@
</patternset>
<patternset id="toohard">
<exclude name="org/apache/tools/ant/taskdefs/Ant.java"/>
<exclude name="org/apache/tools/ant/taskdefs/AntStructure.java"/>
<exclude name="org/apache/tools/ant/taskdefs/Recorder.java"/>
<exclude name="org/apache/tools/ant/taskdefs/RecorderEntry.java"/>
<exclude name="org/apache/tools/ant/taskdefs/CallTarget.java"/>
<exclude name="org/apache/tools/ant/taskdefs/optional/sound/*.java"/>
<exclude name="org/apache/tools/ant/taskdefs/optional/Native2Ascii.java"/>
<exclude name="org/apache/tools/ant/taskdefs/optional/Javah.java"/>
@@ -37,9 +35,12 @@
<exclude name="org/apache/tools/ant/taskdefs/Parallel.java"/>
<exclude name="org/apache/tools/ant/taskdefs/Sequential.java"/>
<exclude name="org/apache/tools/ant/taskdefs/optional/ejb/**/*.java"/>
<exclude name="org/apache/tools/ant/taskdefs/optional/jdepend/*.java"/>
</patternset>
<patternset id="converted">
<exclude name="org/apache/tools/ant/taskdefs/Ant.java"/>
<exclude name="org/apache/tools/ant/taskdefs/CallTarget.java"/>
</patternset>

<fileset id="ant1src" dir="../../src/main">


+ 1
- 1
proposal/mutant/build.xml View File

@@ -162,7 +162,7 @@
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath refid="checkstyle.path"/>
</taskdef>
<mkdir dir="${bin.dir}/checkstyle"/>
<mkdir dir="${bin.dir}/check"/>
<checkstyle maxlinelen="80"
memberpattern="[a-z].*"
parampattern="[a-z].*"


+ 0
- 1
proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionFrame.java View File

@@ -76,7 +76,6 @@ import org.apache.ant.common.util.AntException;
import org.apache.ant.common.util.ConfigException;
import org.apache.ant.common.util.ExecutionException;
import org.apache.ant.common.util.FileUtils;
import org.apache.ant.common.util.Location;
import org.apache.ant.common.util.MessageLevel;
import org.apache.ant.init.InitConfig;



+ 33
- 12
proposal/mutant/src/java/antlibs/system/code/org/apache/ant/antlib/system/AntBase.java View File

@@ -56,9 +56,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ant.common.antlib.AbstractComponent;
import org.apache.ant.common.antlib.AbstractTask;
import org.apache.ant.common.antlib.AntContext;
import org.apache.ant.common.antlib.AbstractComponent;
import org.apache.ant.common.service.DataService;
import org.apache.ant.common.util.ExecutionException;

@@ -80,7 +80,7 @@ public abstract class AntBase extends AbstractTask {
/** The property name */
private String name;

/** The property value*/
/** The property value */
private String value;


@@ -103,7 +103,7 @@ public abstract class AntBase extends AbstractTask {
}

/**
* Gets the name of the Property
* Gets the name of the Property
*
* @return the name value
*/
@@ -119,13 +119,20 @@ public abstract class AntBase extends AbstractTask {
public String getValue() {
return value;
}

/**
* Validate this data type instance
*
* @exception ExecutionException if either attribute has not been set
*/
public void validateComponent() throws ExecutionException {
if (name == null) {
throw new ExecutionException("\"name\" attribute of <property> must be supplied");
throw new ExecutionException("\"name\" attribute of "
+ "<property> must be supplied");
}
if (value == null) {
throw new ExecutionException("\"value\" attribute of <property> must be supplied");
throw new ExecutionException("\"value\" attribute of "
+ "<property> must be supplied");
}
}
}
@@ -178,9 +185,15 @@ public abstract class AntBase extends AbstractTask {
return toId;
}

/**
* Validate this data type instance
*
* @exception ExecutionException if the refid attribute has not been set
*/
public void validateComponent() throws ExecutionException {
if (refId == null) {
throw new ExecutionException("\"refid\" attribute of <reference> must be supplied");
throw new ExecutionException("\"refid\" attribute of "
+ "<reference> must be supplied");
}
}
}
@@ -188,10 +201,16 @@ public abstract class AntBase extends AbstractTask {
/** The name of the target to be evaluated in the sub-build */
private String targetName;

/** flag which indicates if all current properties should be passed to the subbuild */
/**
* flag which indicates if all current properties should be passed to
* the subbuild
*/
private boolean inheritAll = true;

/** flag which indicates if all current references should be passed to the subbuild */
/**
* flag which indicates if all current references should be passed to
* the subbuild
*/
private boolean inheritRefs = false;

/** The properties which will be passed to the sub-build */
@@ -203,7 +222,7 @@ public abstract class AntBase extends AbstractTask {
/**
* Sets the target to be executed in the subbuild
*
* @param targetName the name of the target to build
* @param targetName the name of the target to build
*/
public void setTarget(String targetName) {
this.targetName = targetName;
@@ -221,7 +240,8 @@ public abstract class AntBase extends AbstractTask {
/**
* Indicate if all references are to be passed to the subbuild
*
* @param inheritRefs true if the sub-build should be given all the current references
* @param inheritRefs true if the sub-build should be given all the
* current references
*/
public void setInheritRefs(boolean inheritRefs) {
this.inheritRefs = inheritRefs;
@@ -251,7 +271,8 @@ public abstract class AntBase extends AbstractTask {
* Add a reference to be passed
*
* @param reference the descriptor of the reference to be passed
* @exception ExecutionException if the reference does not reference a valid object
* @exception ExecutionException if the reference does not reference a
* valid object
*/
public void addReference(Reference reference) throws ExecutionException {
String refId = reference.getRefId();


+ 4
- 3
proposal/mutant/src/java/common/org/apache/ant/common/antlib/AbstractComponent.java View File

@@ -80,7 +80,6 @@ public abstract class AbstractComponent implements ExecutionComponent {
* Validate the component. This is called after the element has been
* configured from its build model. The element may perform validation
* of its configuration

*
* @exception ExecutionException if validation fails
*/
@@ -100,9 +99,11 @@ public abstract class AbstractComponent implements ExecutionComponent {
/**
* Short cut to get a core service instance
*
* @param serviceClass the required interface of which an instance is required
* @param serviceClass the required interface of which an instance is
* required
* @return the core's instance of the requested service
* @exception ExecutionException if the core does not support the requested service
* @exception ExecutionException if the core does not support the
* requested service
*/
protected Object getCoreService(Class serviceClass)
throws ExecutionException {


+ 2
- 1
proposal/mutant/src/java/common/org/apache/ant/common/util/AntException.java View File

@@ -146,7 +146,8 @@ public abstract class AntException extends Exception {
* Sets the file location where the error occured.
*
* @param newLocation the new location value
* @param override true if the location should override any currently set location
* @param override true if the location should override any currently
* set location
*/
public void setLocation(Location newLocation, boolean override) {
if (override || location == Location.UNKNOWN_LOCATION) {


Loading…
Cancel
Save