Browse Source

Encapsulate some fields in Task and add some deprecation warnings to coresponding fields.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273157 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
f9121ee81e
95 changed files with 362 additions and 325 deletions
  1. +45
    -8
      src/main/org/apache/tools/ant/Task.java
  2. +8
    -8
      src/main/org/apache/tools/ant/UnknownElement.java
  3. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
  4. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Ant.java
  5. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/AntStructure.java
  6. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Available.java
  7. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/BUnzip2.java
  8. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/BZip2.java
  9. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Basename.java
  10. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/CallTarget.java
  11. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/Checksum.java
  12. +8
    -8
      src/main/org/apache/tools/ant/taskdefs/Chmod.java
  13. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Copy.java
  14. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Copydir.java
  15. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Copyfile.java
  16. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Definer.java
  17. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Delete.java
  18. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Deltree.java
  19. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Dirname.java
  20. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Ear.java
  21. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Echo.java
  22. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Exec.java
  23. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  24. +10
    -10
      src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  25. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Expand.java
  26. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Filter.java
  27. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  28. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/GUnzip.java
  29. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/GZip.java
  30. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/Get.java
  31. +8
    -8
      src/main/org/apache/tools/ant/taskdefs/JDBCTask.java
  32. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Java.java
  33. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Javac.java
  34. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  35. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/LoadFile.java
  36. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/LoadProperties.java
  37. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/ManifestTask.java
  38. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Mkdir.java
  39. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Move.java
  40. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Pack.java
  41. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/Patch.java
  42. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Property.java
  43. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Rename.java
  44. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/Replace.java
  45. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Rmic.java
  46. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java
  47. +8
    -8
      src/main/org/apache/tools/ant/taskdefs/Tar.java
  48. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Touch.java
  49. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Tstamp.java
  50. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Unpack.java
  51. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Untar.java
  52. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/UpToDate.java
  53. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/War.java
  54. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
  55. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/Zip.java
  56. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  57. +7
    -7
      src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
  58. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/IContract.java
  59. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  60. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
  61. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
  62. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
  63. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
  64. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCheck.java
  65. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
  66. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMReconfigure.java
  67. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java
  68. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckin.java
  69. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java
  70. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCUnCheckout.java
  71. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCUpdate.java
  72. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
  73. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
  74. +11
    -11
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
  75. +9
    -9
      src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java
  76. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  77. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java
  78. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  79. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  80. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  81. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  82. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java
  83. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckin.java
  84. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckout.java
  85. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSGet.java
  86. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSLabel.java
  87. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  88. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSADD.java
  89. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java
  90. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java
  91. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCP.java
  92. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCREATE.java
  93. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java
  94. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSHISTORY.java
  95. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java

+ 45
- 8
src/main/org/apache/tools/ant/Task.java View File

@@ -65,12 +65,26 @@ import java.util.Enumeration;
* @see Project#createTask
*/
public abstract class Task extends ProjectComponent {
/** Target this task belongs to, if any. */
/**
* Target this task belongs to, if any.
* @deprecated You should not be accessing this variable directly.
* Please use the {@link #getOwningTarget()} method.
*/
protected Target target;
/** Description of this task, if any. */

/**
* Description of this task, if any.
* @deprecated You should not be accessing this variable directly.
*/
protected String description;
/** Location within the build file of this task definition. */

/**
* Location within the build file of this task definition.
* @deprecated You should not be accessing this variable directly.
* Please use the {@link #getLocation()} method.
*/
protected Location location = Location.UNKNOWN_LOCATION;

/**
* Name of this task to be used for logging purposes.
* This defaults to the same as the type, but may be
@@ -78,18 +92,33 @@ public abstract class Task extends ProjectComponent {
* isn't terribly descriptive for a task used within
* another task - the outer task code can probably
* provide a better one.
* @deprecated You should not be accessing this variable directly.
* Please use the {@link #getTaskName()} method.
*/
protected String taskName;

/**
* Type of this task.
*
* @deprecated You should not be accessing this variable directly.
* Please use the {@link #getTaskType()} method.
*/
protected String taskType;

/**
* Wrapper for this object, used to configure it at runtime.
*
* @deprecated You should not be accessing this variable directly.
* Please use the {@link #getWrapper()} method.
*/
protected String taskName = null;
/** Type of this task. */
protected String taskType = null;
/** Wrapper for this object, used to configure it at runtime. */
protected RuntimeConfigurable wrapper;

/**
* Whether or not this task is invalid. A task becomes invalid
* if a conflicting class is specified as the implementation for
* its type.
*/
private boolean invalid = false;
private boolean invalid;

/** Sole constructor. */
public Task() {
@@ -401,4 +430,12 @@ public abstract class Task extends ProjectComponent {
replaceChildren(childWrapper, childElement);
}
}

protected String getTaskType() {
return taskType;
}

protected RuntimeConfigurable getWrapper() {
return wrapper;
}
}

+ 8
- 8
src/main/org/apache/tools/ant/UnknownElement.java View File

@@ -112,16 +112,16 @@ public class UnknownElement extends Task {
* @exception BuildException if the configuration fails
*/
public void maybeConfigure() throws BuildException {
realThing = makeObject(this, wrapper);
realThing = makeObject(this, getWrapper());

wrapper.setProxy(realThing);
getWrapper().setProxy(realThing);
if (realThing instanceof Task) {
((Task) realThing).setRuntimeConfigurableWrapper(wrapper);
((Task) realThing).setRuntimeConfigurableWrapper(getWrapper());
}

handleChildren(realThing, wrapper);
handleChildren(realThing, getWrapper());

wrapper.maybeConfigure(getProject());
getWrapper().maybeConfigure(getProject());
}

/**
@@ -159,7 +159,7 @@ public class UnknownElement extends Task {
// plain impossible to get here, maybeConfigure should
// have thrown an exception.
throw new BuildException("Could not create task of type: "
+ elementName, location);
+ elementName, getLocation());
}

if (realThing instanceof Task) {
@@ -271,7 +271,7 @@ public class UnknownElement extends Task {
if (task != null) {
task.setLocation(getLocation());
// UnknownElement always has an associated target
task.setOwningTarget(target);
task.setOwningTarget(getOwningTarget());
task.init();
}
return task;
@@ -325,7 +325,7 @@ public class UnknownElement extends Task {
+ "as this is not an Ant bug.";


return new BuildException(msg, location);
return new BuildException(msg, getLocation());
}

/**


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java View File

@@ -214,7 +214,7 @@ public abstract class AbstractCvsTask extends Task {
.getPath(),
append))));
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
} else {
setOutputStream(new LogOutputStream(this, Project.MSG_INFO));
@@ -241,7 +241,7 @@ public abstract class AbstractCvsTask extends Task {
new FileOutputStream(error.getPath(),
append))));
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
} else {
setErrorStream(new LogOutputStream(this, Project.MSG_WARN));
@@ -333,11 +333,11 @@ public abstract class AbstractCvsTask extends Task {
+ retCode
+ StringUtils.LINE_SEP
+ "Command line was ["
+ actualCommandLine + "]", location);
+ actualCommandLine + "]", getLocation());
}
} catch (IOException e) {
if (failOnError) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
} else {
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
}
@@ -353,7 +353,7 @@ public abstract class AbstractCvsTask extends Task {
}
} catch (Exception e) {
if (failOnError) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
} else {
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
}


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

@@ -488,7 +488,7 @@ public class Ant extends Task {
} catch (Exception e2) {
String msg = "Error setting new project instance for "
+ "reference with id " + oldKey;
throw new BuildException(msg, e2, location);
throw new BuildException(msg, e2, getLocation());
}
}
newProject.addReference(newKey, copy);


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/AntStructure.java View File

@@ -110,7 +110,7 @@ public class AntStructure extends Task {
public void execute() throws BuildException {

if (output == null) {
throw new BuildException("output attribute is required", location);
throw new BuildException("output attribute is required", getLocation());
}

PrintWriter out = null;
@@ -147,8 +147,8 @@ public class AntStructure extends Task {
}

} catch (IOException ioe) {
throw new BuildException("Error writing "
+ output.getAbsolutePath(), ioe, location);
throw new BuildException("Error writing "
+ output.getAbsolutePath(), ioe, getLocation());
} finally {
if (out != null) {
out.close();
@@ -349,8 +349,8 @@ public class AntStructure extends Task {
final int count = v.size();
for (int i = 0; i < count; i++) {
String nestedName = (String) v.elementAt(i);
if (!"#PCDATA".equals(nestedName)
&& !TASKS.equals(nestedName)
if (!"#PCDATA".equals(nestedName)
&& !TASKS.equals(nestedName)
&& !TYPES.equals(nestedName)) {
printElementDecl(out, nestedName, ih.getElementType(nestedName));
}


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

@@ -240,7 +240,7 @@ public class Available extends Task implements Condition {
public void execute() throws BuildException {
if (property == null) {
throw new BuildException("property attribute is required",
location);
getLocation());
}

isTask = true;
@@ -269,14 +269,14 @@ public class Available extends Task implements Condition {
public boolean eval() throws BuildException {
if (classname == null && file == null && resource == null) {
throw new BuildException("At least one of (classname|file|"
+ "resource) is required", location);
+ "resource) is required", getLocation());
}

if (type != null) {
if (file == null) {
throw new BuildException("The type attribute is only valid "
+ "when specifying the file "
+ "attribute.", location);
+ "attribute.", getLocation());
}
}



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

@@ -97,11 +97,11 @@ public class BUnzip2 extends Unpack {
bis = new BufferedInputStream(fis);
int b = bis.read();
if (b != 'B') {
throw new BuildException("Invalid bz2 file.", location);
throw new BuildException("Invalid bz2 file.", getLocation());
}
b = bis.read();
if (b != 'Z') {
throw new BuildException("Invalid bz2 file.", location);
throw new BuildException("Invalid bz2 file.", getLocation());
}
zIn = new CBZip2InputStream(bis);
byte[] buffer = new byte[8 * 1024];
@@ -112,7 +112,7 @@ public class BUnzip2 extends Unpack {
} while (count != -1);
} catch (IOException ioe) {
String msg = "Problem expanding bzip2 " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
} finally {
if (bis != null) {
try {


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

@@ -84,7 +84,7 @@ public class BZip2 extends Pack {
zipFile(source, zOut);
} catch (IOException ioe) {
String msg = "Problem creating bzip2 " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
} finally {
if (zOut != null) {
try {


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Basename.java View File

@@ -119,10 +119,10 @@ public class Basename extends Task {
// The method executing the task
public void execute() throws BuildException {
if (property == null) {
throw new BuildException("property attribute required", location);
throw new BuildException("property attribute required", getLocation());
}
if (file == null) {
throw new BuildException("file attribute required", location);
throw new BuildException("file attribute required", getLocation());
}
String value = file.getName();
if (suffix != null && value.endsWith(suffix)) {


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

@@ -133,7 +133,7 @@ public class CallTarget extends Task {
if (subTarget == null) {
throw new BuildException("Attribute target is required.",
location);
getLocation());
}
callee.setAntfile(getProject().getProperty("ant.file"));


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/Checksum.java View File

@@ -284,21 +284,21 @@ public class Checksum extends MatchingTask implements Condition {
try {
messageDigest = MessageDigest.getInstance(algorithm, provider);
} catch (NoSuchAlgorithmException noalgo) {
throw new BuildException(noalgo, location);
throw new BuildException(noalgo, getLocation());
} catch (NoSuchProviderException noprovider) {
throw new BuildException(noprovider, location);
throw new BuildException(noprovider, getLocation());
}
} else {
try {
messageDigest = MessageDigest.getInstance(algorithm);
} catch (NoSuchAlgorithmException noalgo) {
throw new BuildException(noalgo, location);
throw new BuildException(noalgo, getLocation());
}
}

if (messageDigest == null) {
throw new BuildException("Unable to create Message Digest",
location);
getLocation());
}

if (fileext == null) {
@@ -354,7 +354,7 @@ public class Checksum extends MatchingTask implements Condition {
+ file.getAbsolutePath()
+ " to generate checksum for.";
log(message);
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
}
}
}
@@ -429,7 +429,7 @@ public class Checksum extends MatchingTask implements Condition {
}
}
} catch (Exception e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
} finally {
if (fis != null) {
try {


+ 8
- 8
src/main/org/apache/tools/ant/taskdefs/Chmod.java View File

@@ -190,7 +190,7 @@ public class Chmod extends ExecuteOn {
protected void checkConfiguration() {
if (!havePerm) {
throw new BuildException("Required attribute perm not set in chmod",
location);
getLocation());
}

if (defaultSetDefined && defaultSet.getDir(getProject()) != null) {
@@ -224,7 +224,7 @@ public class Chmod extends ExecuteOn {
execute.setCommandline(cloned.getCommandline());
runExecute(execute);
} catch (IOException e) {
throw new BuildException("Execute failed: " + e, e, location);
throw new BuildException("Execute failed: " + e, e, getLocation());
} finally {
// close the output file if required
logFlush();
@@ -236,24 +236,24 @@ public class Chmod extends ExecuteOn {
* @ant.attribute ignore="true"
*/
public void setExecutable(String e) {
throw new BuildException(taskType
+ " doesn\'t support the executable attribute", location);
throw new BuildException(getTaskType()
+ " doesn\'t support the executable attribute", getLocation());
}

/**
* @ant.attribute ignore="true"
*/
public void setCommand(Commandline cmdl) {
throw new BuildException(taskType
+ " doesn\'t support the command attribute", location);
throw new BuildException(getTaskType()
+ " doesn\'t support the command attribute", getLocation());
}

/**
* @ant.attribute ignore="true"
*/
public void setSkipEmptyFilesets(boolean skip) {
throw new BuildException(taskType
+ " doesn\'t support the skipemptyfileset attribute", location);
throw new BuildException(getTaskType()
+ " doesn\'t support the skipemptyfileset attribute", getLocation());
}

protected boolean isValidOs() {


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Copy.java View File

@@ -280,7 +280,7 @@ public class Copy extends Task {
public Mapper createMapper() throws BuildException {
if (mapperElement != null) {
throw new BuildException("Cannot define more than one mapper",
location);
getLocation());
}
mapperElement = new Mapper(getProject());
return mapperElement;
@@ -531,7 +531,7 @@ public class Copy extends Task {
} catch (IOException ioe) {
String msg = "Failed to copy " + fromFile + " to " + toFile
+ " due to " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
}
}
}


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

@@ -106,17 +106,17 @@ public class Copydir extends MatchingTask {

if (srcDir == null) {
throw new BuildException("src attribute must be set!",
location);
getLocation());
}

if (!srcDir.exists()) {
throw new BuildException("srcdir " + srcDir.toString()
+ " does not exist!", location);
+ " does not exist!", getLocation());
}

if (destDir == null) {
throw new BuildException("The dest attribute must be set.",
location);
getLocation());
}

if (srcDir.equals(destDir)) {
@@ -142,7 +142,7 @@ public class Copydir extends MatchingTask {
} catch (IOException ioe) {
String msg = "Failed to copy " + fromFile + " to "
+ toFile + " due to " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
}
}
}


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

@@ -100,17 +100,17 @@ public class Copyfile extends Task {

if (srcFile == null) {
throw new BuildException("The src attribute must be present.",
location);
getLocation());
}
if (!srcFile.exists()) {
throw new BuildException("src " + srcFile.toString()
+ " does not exist.", location);
+ " does not exist.", getLocation());
}

if (destFile == null) {
throw new BuildException("The dest attribute must be present.",
location);
getLocation());
}

if (srcFile.equals(destFile)) {


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Definer.java View File

@@ -168,13 +168,13 @@ public abstract class Definer extends Task {
if (name != null || value != null) {
String msg = "You must not specify name or value "
+ "together with file or resource.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

if (file != null && resource != null) {
String msg = "You must not specify both, file and "
+ "resource.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}


@@ -209,7 +209,7 @@ public abstract class Definer extends Task {
}
}
} catch (IOException ex) {
throw new BuildException(ex, location);
throw new BuildException(ex, getLocation());
} finally {
if (is != null) {
try {
@@ -233,11 +233,11 @@ public abstract class Definer extends Task {
} catch (ClassNotFoundException cnfe) {
String msg = getTaskName() + " class " + value
+ " cannot be found";
throw new BuildException(msg, cnfe, location);
throw new BuildException(msg, cnfe, getLocation());
} catch (NoClassDefFoundError ncdfe) {
String msg = getTaskName() + " class " + value
+ " cannot be found";
throw new BuildException(msg, ncdfe, location);
throw new BuildException(msg, ncdfe, getLocation());
}
}



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

@@ -279,7 +279,7 @@ public class Delete extends MatchingTask {

if (quiet && failonerror) {
throw new BuildException("quiet and failonerror cannot both be "
+ "set to true", location);
+ "set to true", getLocation());
}



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

@@ -94,7 +94,7 @@ public class Deltree extends Task {
+ "Use delete instead.");

if (dir == null) {
throw new BuildException("dir attribute must be set!", location);
throw new BuildException("dir attribute must be set!", getLocation());
}

if (dir.exists()) {
@@ -102,7 +102,7 @@ public class Deltree extends Task {
if (!dir.delete()) {
throw new BuildException("Unable to delete directory "
+ dir.getAbsolutePath(),
location);
getLocation());
}
return;
}
@@ -113,7 +113,7 @@ public class Deltree extends Task {
removeDir(dir);
} catch (IOException ioe) {
String msg = "Unable to delete " + dir.getAbsolutePath();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}
}


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Dirname.java View File

@@ -107,10 +107,10 @@ public class Dirname extends Task {
// The method executing the task
public void execute() throws BuildException {
if (property == null) {
throw new BuildException("property attribute required", location);
throw new BuildException("property attribute required", getLocation());
}
if (file == null) {
throw new BuildException("file attribute required", location);
throw new BuildException("file attribute required", getLocation());
} else {
String value = file.getParent();
getProject().setNewProperty(property, value);


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

@@ -129,7 +129,7 @@ public class Ear extends Jar {
throws IOException, BuildException {
// If no webxml file is specified, it's an error.
if (deploymentDescriptor == null && !isInUpdateMode()) {
throw new BuildException("appxml attribute is required", location);
throw new BuildException("appxml attribute is required", getLocation());
}

super.initZipOutputStream(zOut);


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

@@ -93,7 +93,7 @@ public class Echo extends Task {
out = new FileWriter(file.getAbsolutePath(), append);
out.write(message, 0, message.length());
} catch (IOException ioe) {
throw new BuildException(ioe, location);
throw new BuildException(ioe, getLocation());
} finally {
if (out != null) {
try {


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Exec.java View File

@@ -125,7 +125,7 @@ public class Exec extends Task {
String ant = getProject().getProperty("ant.home");
if (ant == null) {
throw new BuildException("Property 'ant.home' not "
+ "found", location);
+ "found", getLocation());
}
String antRun = getProject().resolveFile(ant + "/bin/antRun.bat").toString();
@@ -135,8 +135,8 @@ public class Exec extends Task {
} else {
String ant = getProject().getProperty("ant.home");
if (ant == null) {
throw new BuildException("Property 'ant.home' not found",
location);
throw new BuildException("Property 'ant.home' not found",
getLocation());
}
String antRun = getProject().resolveFile(ant + "/bin/antRun").toString();

@@ -178,13 +178,13 @@ public class Exec extends Task {
err = proc.exitValue();
if (err != 0) {
if (failOnError) {
throw new BuildException("Exec returned: " + err, location);
throw new BuildException("Exec returned: " + err, getLocation());
} else {
log("Result: " + err, Project.MSG_ERR);
}
}
} catch (IOException ioe) {
throw new BuildException("Error exec: " + command, ioe, location);
throw new BuildException("Error exec: " + command, ioe, getLocation());
} catch (InterruptedException ex) {}

return err;


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/ExecTask.java View File

@@ -259,7 +259,7 @@ public class ExecTask extends Task {
*/
protected void checkConfiguration() throws BuildException {
if (cmdl.getExecutable() == null) {
throw new BuildException("no executable specified", location);
throw new BuildException("no executable specified", getLocation());
}
if (dir != null && !dir.exists()) {
throw new BuildException("The directory you specified does not "
@@ -334,8 +334,8 @@ public class ExecTask extends Task {
maybeSetResultPropertyValue(err);
if (err != 0) {
if (failOnError) {
throw new BuildException(taskType + " returned: " + err,
location);
throw new BuildException(getTaskType() + " returned: " + err,
getLocation());
} else {
log("Result: " + err, Project.MSG_ERR);
}
@@ -369,7 +369,7 @@ public class ExecTask extends Task {
} catch (IOException e) {
if (failIfExecFails) {
throw new BuildException("Execute failed: " + e.toString(), e,
location);
getLocation());
} else {
log("Execute failed: " + e.toString(), Project.MSG_ERR);
}
@@ -390,10 +390,10 @@ public class ExecTask extends Task {
return new PumpStreamHandler(fos);
} catch (FileNotFoundException fne) {
throw new BuildException("Cannot write to " + out, fne,
location);
getLocation());
} catch (IOException ioe) {
throw new BuildException("Cannot write to " + out, ioe,
location);
getLocation());
}
} else if (outputprop != null) {
baos = new ByteArrayOutputStream();


+ 10
- 10
src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java View File

@@ -151,8 +151,8 @@ public class ExecuteOn extends ExecTask {
*/
public Commandline.Marker createSrcfile() {
if (srcFilePos != null) {
throw new BuildException(taskType + " doesn\'t support multiple "
+ "srcfile elements.", location);
throw new BuildException(getTaskType() + " doesn\'t support multiple "
+ "srcfile elements.", getLocation());
}
srcFilePos = cmdl.createMarker();
return srcFilePos;
@@ -164,8 +164,8 @@ public class ExecuteOn extends ExecTask {
*/
public Commandline.Marker createTargetfile() {
if (targetFilePos != null) {
throw new BuildException(taskType + " doesn\'t support multiple "
+ "targetfile elements.", location);
throw new BuildException(getTaskType() + " doesn\'t support multiple "
+ "targetfile elements.", getLocation());
}
targetFilePos = cmdl.createMarker();
srcIsFirst = (srcFilePos != null);
@@ -178,7 +178,7 @@ public class ExecuteOn extends ExecTask {
public Mapper createMapper() throws BuildException {
if (mapperElement != null) {
throw new BuildException("Cannot define more than one mapper",
location);
getLocation());
}
mapperElement = new Mapper(getProject());
return mapperElement;
@@ -189,24 +189,24 @@ public class ExecuteOn extends ExecTask {
* this should probably be modified to use the classname instead.
*/
protected void checkConfiguration() {
if ("execon".equals(taskName)) {
if ("execon".equals(getTaskName())) {
log("!! execon is deprecated. Use apply instead. !!");
}
super.checkConfiguration();
if (filesets.size() == 0) {
throw new BuildException("no filesets specified", location);
throw new BuildException("no filesets specified", getLocation());
}

if (targetFilePos != null || mapperElement != null
|| destDir != null) {

if (mapperElement == null) {
throw new BuildException("no mapper specified", location);
throw new BuildException("no mapper specified", getLocation());
}
if (destDir == null) {
throw new BuildException("no dest attribute specified",
location);
getLocation());
}
mapper = mapperElement.getImplementation();
}
@@ -271,7 +271,7 @@ public class ExecuteOn extends ExecTask {
}

} catch (IOException e) {
throw new BuildException("Execute failed: " + e, e, location);
throw new BuildException("Execute failed: " + e, e, getLocation());
} finally {
// close the output file if required
logFlush();


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

@@ -99,7 +99,7 @@ public class Expand extends Task {
* @exception BuildException Thrown in unrecoverable error.
*/
public void execute() throws BuildException {
if ("expand".equals(taskType)) {
if ("expand".equals(getTaskType())) {
log("!! expand is deprecated. Use unzip instead. !!");
}

@@ -114,7 +114,7 @@ public class Expand extends Task {
}

if (dest.exists() && !dest.isDirectory()) {
throw new BuildException("Dest must be a directory.", location);
throw new BuildException("Dest must be a directory.", getLocation());
}

FileUtils fileUtils = FileUtils.newFileUtils();
@@ -122,7 +122,7 @@ public class Expand extends Task {
if (source != null) {
if (source.isDirectory()) {
throw new BuildException("Src must not be a directory." +
" Use nested filesets instead.", location);
" Use nested filesets instead.", getLocation());
} else {
expandFile(fileUtils, source, dest);
}


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

@@ -115,7 +115,7 @@ public class Filter extends Task {
if (!isFiltersFromFile && !isSingleFilter) {
throw new BuildException("both token and value parameters, or "
+ "only a filtersFile parameter is "
+ "required", location);
+ "required", getLocation());
}

if (isSingleFilter) {


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

@@ -299,7 +299,7 @@ public class FixCRLF extends MatchingTask {
public void setTablength(int tlength) throws BuildException {
if (tlength < 2 || tlength > 80) {
throw new BuildException("tablength must be between 2 and 80",
location);
getLocation());
}
tablength = tlength;
StringBuffer sp = new StringBuffer();


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

@@ -102,7 +102,7 @@ public class GUnzip extends Unpack {
} while (count != -1);
} catch (IOException ioe) {
String msg = "Problem expanding gzip " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
} finally {
if (fis != null) {
try {


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

@@ -81,7 +81,7 @@ public class GZip extends Pack {
zipFile(source, zOut);
} catch (IOException ioe) {
String msg = "Problem creating gzip " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
} finally {
if (zOut != null) {
try {


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/Get.java View File

@@ -98,21 +98,21 @@ public class Get extends Task {
*/
public void execute() throws BuildException {
if (source == null) {
throw new BuildException("src attribute is required", location);
throw new BuildException("src attribute is required", getLocation());
}

if (dest == null) {
throw new BuildException("dest attribute is required", location);
throw new BuildException("dest attribute is required", getLocation());
}

if (dest.exists() && dest.isDirectory()) {
throw new BuildException("The specified destination is a directory",
location);
getLocation());
}

if (dest.exists() && !dest.canWrite()) {
throw new BuildException("Can't write to " + dest.getAbsolutePath(),
location);
getLocation());
}

try {
@@ -209,7 +209,7 @@ public class Get extends Task {
return;
}
throw new BuildException("Can't get " + source + " to " + dest,
location);
getLocation());
}

FileOutputStream fos = new FileOutputStream(dest);
@@ -263,7 +263,7 @@ public class Get extends Task {
if (ignoreErrors) {
return;
}
throw new BuildException(ioe, location);
throw new BuildException(ioe, getLocation());
}
}



+ 8
- 8
src/main/org/apache/tools/ant/taskdefs/JDBCTask.java View File

@@ -325,13 +325,13 @@ public abstract class JDBCTask extends Task {
*/
protected Connection getConnection() throws BuildException {
if (userId == null) {
throw new BuildException("User Id attribute must be set!", location);
throw new BuildException("User Id attribute must be set!", getLocation());
}
if (password == null) {
throw new BuildException("Password attribute must be set!", location);
throw new BuildException("Password attribute must be set!", getLocation());
}
if (url == null) {
throw new BuildException("Url attribute must be set!", location);
throw new BuildException("Url attribute must be set!", getLocation());
}
try {

@@ -349,7 +349,7 @@ public abstract class JDBCTask extends Task {
conn.setAutoCommit(autocommit);
return conn;
} catch (SQLException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}

}
@@ -362,7 +362,7 @@ public abstract class JDBCTask extends Task {
*/
private Driver getDriver() throws BuildException {
if (driver == null) {
throw new BuildException("Driver attribute must be set!", location);
throw new BuildException("Driver attribute must be set!", getLocation());
}

Driver driverInstance = null;
@@ -402,15 +402,15 @@ public abstract class JDBCTask extends Task {
} catch (ClassNotFoundException e) {
throw new BuildException(
"Class Not Found: JDBC driver " + driver + " could not be loaded",
location);
getLocation());
} catch (IllegalAccessException e) {
throw new BuildException(
"Illegal Access: JDBC driver " + driver + " could not be loaded",
location);
getLocation());
} catch (InstantiationException e) {
throw new BuildException(
"Instantiation Exception: JDBC driver " + driver + " could not be loaded",
location);
getLocation());
}
return driverInstance;
}


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -107,7 +107,7 @@ public class Java extends Task {
try {
if ((err = executeJava()) != 0) {
if (failOnError) {
throw new BuildException("Java returned: " + err, location);
throw new BuildException("Java returned: " + err, getLocation());
} else {
log("Java Result: " + err, Project.MSG_ERR);
}
@@ -405,7 +405,7 @@ public class Java extends Task {
append));
exe.execute(getProject());
} catch (IOException io) {
throw new BuildException(io, location);
throw new BuildException(io, getLocation());
} finally {
if (outStream != null) {
outStream.close();
@@ -440,7 +440,7 @@ public class Java extends Task {
} else if (!dir.exists() || !dir.isDirectory()) {
throw new BuildException(dir.getAbsolutePath()
+ " is not a valid directory",
location);
getLocation());
}
exe.setWorkingDirectory(dir);
@@ -463,10 +463,10 @@ public class Java extends Task {
}
return rc;
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
} catch (IOException io) {
throw new BuildException(io, location);
throw new BuildException(io, getLocation());
} finally {
if (fos != null) {
try {fos.close();} catch (IOException io) {}


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -670,7 +670,7 @@ public class Javac extends MatchingTask {
if (!srcDir.exists()) {
throw new BuildException("srcdir \""
+ srcDir.getPath()
+ "\" does not exist!", location);
+ "\" does not exist!", getLocation());
}

DirectoryScanner ds = this.getDirectoryScanner(srcDir);
@@ -794,18 +794,18 @@ public class Javac extends MatchingTask {
protected void checkParameters() throws BuildException {
if (src == null) {
throw new BuildException("srcdir attribute must be set!",
location);
getLocation());
}
if (src.size() == 0) {
throw new BuildException("srcdir attribute must be set!",
location);
getLocation());
}

if (destDir != null && !destDir.isDirectory()) {
throw new BuildException("destination directory \""
+ destDir
+ "\" does not exist "
+ "or is not a directory", location);
+ "or is not a directory", getLocation());
}
}

@@ -839,7 +839,7 @@ public class Javac extends MatchingTask {
// finally, lets execute the compiler!!
if (!adapter.execute()) {
if (failOnError) {
throw new BuildException(FAIL_MSG, location);
throw new BuildException(FAIL_MSG, getLocation());
} else {
log(FAIL_MSG, Project.MSG_ERR);
}


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -1498,7 +1498,7 @@ public class Javadoc extends Task {
}

public void execute() throws BuildException {
if ("javadoc2".equals(taskType)) {
if ("javadoc2".equals(getTaskType())) {
log("!! javadoc2 is deprecated. Use javadoc instead. !!");
}

@@ -1598,7 +1598,7 @@ public class Javadoc extends Task {
if (doclet != null) {
if (doclet.getName() == null) {
throw new BuildException("The doclet name must be "
+ "specified.", location);
+ "specified.", getLocation());
} else {
toExecute.createArgument().setValue("-doclet");
toExecute.createArgument().setValue(doclet.getName());
@@ -1806,7 +1806,7 @@ public class Javadoc extends Task {
} catch (IOException e) {
tmpList.delete();
throw new BuildException("Error creating temporary file",
e, location);
e, getLocation());
} finally {
if (srcListWriter != null) {
srcListWriter.close();
@@ -1836,10 +1836,10 @@ public class Javadoc extends Task {
exe.setCommandline(toExecute.getCommandline());
int ret = exe.execute();
if (ret != 0 && failOnError) {
throw new BuildException("Javadoc returned " + ret, location);
throw new BuildException("Javadoc returned " + ret, getLocation());
}
} catch (IOException e) {
throw new BuildException("Javadoc failed: " + e, e, location);
throw new BuildException("Javadoc failed: " + e, e, getLocation());
} finally {
if (tmpList != null) {
tmpList.delete();


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

@@ -206,7 +206,7 @@ public final class LoadFile extends Task {
} catch (final IOException ioe) {
final String message = "Unable to load file: " + ioe.toString();
if (failOnError) {
throw new BuildException(message, ioe, location);
throw new BuildException(message, ioe, getLocation());
} else {
log(message, Project.MSG_ERR);
}


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

@@ -190,7 +190,7 @@ public final class LoadProperties extends Task {

} catch (final IOException ioe) {
final String message = "Unable to load file: " + ioe.toString();
throw new BuildException(message, ioe, location);
throw new BuildException(message, ioe, getLocation());
} catch (final BuildException be) {
throw be;
} finally {


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

@@ -176,10 +176,10 @@ public class ManifestTask extends Task {
current = new Manifest(f);
} catch (ManifestException m) {
error = new BuildException("Existing manifest " + manifestFile
+ " is invalid", m, location);
+ " is invalid", m, getLocation());
} catch (IOException e) {
error = new BuildException("Failed to read " + manifestFile,
e, location);
e, getLocation());
} finally {
if (f != null) {
try {
@@ -200,7 +200,7 @@ public class ManifestTask extends Task {

toWrite.merge(nestedManifest);
} catch (ManifestException m) {
throw new BuildException("Manifest is invalid", m, location);
throw new BuildException("Manifest is invalid", m, getLocation());
}

if (toWrite.equals(current)) {
@@ -215,7 +215,7 @@ public class ManifestTask extends Task {
toWrite.write(w);
} catch (IOException e) {
throw new BuildException("Failed to write " + manifestFile,
e, location);
e, getLocation());
} finally {
if (w != null) {
w.close();


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Mkdir.java View File

@@ -82,7 +82,7 @@ public class Mkdir extends Task {
*/
public void execute() throws BuildException {
if (dir == null) {
throw new BuildException("dir attribute is required", location);
throw new BuildException("dir attribute is required", getLocation());
}

if (dir.isFile()) {
@@ -96,7 +96,7 @@ public class Mkdir extends Task {
if (!result) {
String msg = "Directory " + dir.getAbsolutePath()
+ " creation was not successful for an unknown reason";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
log("Created dir: " + dir.getAbsolutePath());
}


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

@@ -116,7 +116,7 @@ public class Move extends Copy {
String msg = "Failed to rename dir " + fromDir
+ " to " + toDir
+ " due to " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
}
}
}
@@ -148,7 +148,7 @@ public class Move extends Copy {
String msg = "Failed to rename " + fromFile
+ " to " + toFile
+ " due to " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
}

if (!moved) {
@@ -185,7 +185,7 @@ public class Move extends Copy {
String msg = "Failed to copy " + fromFile + " to "
+ toFile
+ " due to " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
}
}
}


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

@@ -99,21 +99,21 @@ public abstract class Pack extends Task {
*/
private void validate() throws BuildException {
if (zipFile == null) {
throw new BuildException("zipfile attribute is required", location);
throw new BuildException("zipfile attribute is required", getLocation());
}

if (zipFile.isDirectory()) {
throw new BuildException("zipfile attribute must not " +
"represent a directory!", location);
"represent a directory!", getLocation());
}

if (source == null) {
throw new BuildException("src attribute is required", location);
throw new BuildException("src attribute is required", getLocation());
}

if (source.isDirectory()) {
throw new BuildException("Src attribute must not " +
"represent a directory!", location);
"represent a directory!", getLocation());
}
}



+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/Patch.java View File

@@ -91,7 +91,7 @@ public class Patch extends Task {
public void setPatchfile(File file) {
if (!file.exists()) {
throw new BuildException("patchfile " + file + " doesn\'t exist",
location);
getLocation());
}
cmd.createArgument().setValue("-i");
cmd.createArgument().setFile(file);
@@ -125,7 +125,7 @@ public class Patch extends Task {
*/
public void setStrip(int num) throws BuildException {
if (num < 0) {
throw new BuildException("strip has to be >= 0", location);
throw new BuildException("strip has to be >= 0", getLocation());
}
cmd.createArgument().setValue("-p" + num);
}
@@ -166,7 +166,7 @@ public class Patch extends Task {
public void execute() throws BuildException {
if (!havePatchfile) {
throw new BuildException("patchfile argument is required",
location);
getLocation());
}
Commandline toExecute = (Commandline) cmd.clone();
toExecute.setExecutable("patch");
@@ -185,10 +185,10 @@ public class Patch extends Task {
exe.setWorkingDirectory(directory);
} else if (!directory.isDirectory()) {
throw new BuildException(directory + " is not a directory.",
location);
getLocation());
} else {
throw new BuildException("directory " + directory
+ " doesn\'t exist", location);
+ " doesn\'t exist", getLocation());
}
} else {
exe.setWorkingDirectory(getProject().getBaseDir());
@@ -198,7 +198,7 @@ public class Patch extends Task {
try {
exe.execute();
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
}



+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Property.java View File

@@ -323,19 +323,19 @@ public class Property extends Task {
if (value == null && ref == null) {
throw new BuildException("You must specify value, location or "
+ "refid with the name attribute",
location);
getLocation());
}
} else {
if (file == null && resource == null && env == null) {
throw new BuildException("You must specify file, resource or "
+ "environment when not using the "
+ "name attribute", location);
+ "name attribute", getLocation());
}
}

if (file == null && resource == null && prefix != null) {
throw new BuildException("Prefix is only valid when loading from "
+ "a file or resource", location);
+ "a file or resource", getLocation());
}

if ((name != null) && (value != null)) {
@@ -392,7 +392,7 @@ public class Property extends Task {
Project.MSG_VERBOSE);
}
} catch (IOException ex) {
throw new BuildException(ex, location);
throw new BuildException(ex, getLocation());
}
}

@@ -426,7 +426,7 @@ public class Property extends Task {
log("Unable to find resource " + name, Project.MSG_WARN);
}
} catch (IOException ex) {
throw new BuildException(ex, location);
throw new BuildException(ex, getLocation());
} finally {
if (is != null) {
try {


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Rename.java View File

@@ -109,11 +109,11 @@ public class Rename extends Task {
log("DEPRECATED - The rename task is deprecated. Use move instead.");

if (dest == null) {
throw new BuildException("dest attribute is required", location);
throw new BuildException("dest attribute is required", getLocation());
}

if (src == null) {
throw new BuildException("src attribute is required", location);
throw new BuildException("src attribute is required", getLocation());
}

if (replace && dest.exists()) {


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/Replace.java View File

@@ -318,21 +318,21 @@ public class Replace extends MatchingTask {
if (src == null && dir == null) {
String message = "Either the file or the dir attribute "
+ "must be specified";
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
}
if (propertyFile != null && !propertyFile.exists()) {
String message = "Property file " + propertyFile.getPath()
+ " does not exist.";
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
}
if (token == null && replacefilters.size() == 0) {
String message = "Either token or a nested replacefilter "
+ "must be specified";
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
}
if (token != null && "".equals(token.getText())) {
String message = "The token attribute must not be an empty string.";
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
}
}

@@ -387,7 +387,7 @@ public class Replace extends MatchingTask {
private void processFile(File src) throws BuildException {
if (!src.exists()) {
throw new BuildException("Replace: source file " + src.getPath()
+ " doesn't exist", location);
+ " doesn't exist", getLocation());
}

File temp = fileUtils.createTempFile("rep", ".tmp",
@@ -474,7 +474,7 @@ public class Replace extends MatchingTask {
} catch (IOException ioe) {
throw new BuildException("IOException in " + src + " - " +
ioe.getClass().getName() + ":"
+ ioe.getMessage(), ioe, location);
+ ioe.getMessage(), ioe, getLocation());
} finally {
if (reader != null) {
try {


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

@@ -477,10 +477,10 @@ public class Rmic extends MatchingTask {
*/
public void execute() throws BuildException {
if (baseDir == null) {
throw new BuildException("base attribute must be set!", location);
throw new BuildException("base attribute must be set!", getLocation());
}
if (!baseDir.exists()) {
throw new BuildException("base does not exist!", location);
throw new BuildException("base does not exist!", getLocation());
}

if (verify) {
@@ -519,7 +519,7 @@ public class Rmic extends MatchingTask {
// finally, lets execute the compiler!!
if (!adapter.execute()) {
throw new BuildException(FAIL_MSG, location);
throw new BuildException(FAIL_MSG, getLocation());
}
}
@@ -594,7 +594,7 @@ public class Rmic extends MatchingTask {
} catch (IOException ioe) {
String msg = "Failed to copy " + oldFile + " to " +
newFile + " due to " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
}
}
}


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

@@ -327,12 +327,12 @@ public class SQLExec extends JDBCTask {
if (transactions.size() == 0) {
throw new BuildException("Source file or fileset, "
+ "transactions or sql statement "
+ "must be set!", location);
+ "must be set!", getLocation());
}
}

if (srcFile != null && !srcFile.exists()) {
throw new BuildException("Source file does not exist!", location);
throw new BuildException("Source file does not exist!", getLocation());
}

// deal with the filesets
@@ -395,14 +395,14 @@ public class SQLExec extends JDBCTask {
conn.rollback();
} catch (SQLException ex) {}
}
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
} catch (SQLException e){
if (!isAutocommit() && conn != null && onError.equals("abort")) {
try {
conn.rollback();
} catch (SQLException ex) {}
}
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
} finally {
try {
if (statement != null) {


+ 8
- 8
src/main/org/apache/tools/ant/taskdefs/Tar.java View File

@@ -227,17 +227,17 @@ public class Tar extends MatchingTask {
public void execute() throws BuildException {
if (tarFile == null) {
throw new BuildException("tarfile attribute must be set!",
location);
getLocation());
}

if (tarFile.exists() && tarFile.isDirectory()) {
throw new BuildException("tarfile is a directory!",
location);
getLocation());
}

if (tarFile.exists() && !tarFile.canWrite()) {
throw new BuildException("Can not write to the specified tarfile!",
location);
getLocation());
}

Vector savedFileSets = (Vector) filesets.clone();
@@ -245,7 +245,7 @@ public class Tar extends MatchingTask {
if (baseDir != null) {
if (!baseDir.exists()) {
throw new BuildException("basedir does not exist!",
location);
getLocation());
}

// add the main fileset to the list of filesets to process.
@@ -257,7 +257,7 @@ public class Tar extends MatchingTask {
if (filesets.size() == 0) {
throw new BuildException("You must supply either a basedir "
+ "attribute or some nested filesets.",
location);
getLocation());
}

// check if tar is out of date with respect to each
@@ -275,7 +275,7 @@ public class Tar extends MatchingTask {
if (tarFile.equals(new File(fs.getDir(getProject()),
files[i]))) {
throw new BuildException("A tar file cannot include "
+ "itself", location);
+ "itself", getLocation());
}
}
}
@@ -324,7 +324,7 @@ public class Tar extends MatchingTask {
}
} catch (IOException ioe) {
String msg = "Problem creating TAR: " + ioe.getMessage();
throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
} finally {
if (tOut != null) {
try {
@@ -394,7 +394,7 @@ public class Tar extends MatchingTask {
} else if (longFileMode.isFailMode()) {
throw new BuildException(
"Entry: " + vPath + " longer than " +
TarConstants.NAMELEN + "characters.", location);
TarConstants.NAMELEN + "characters.", getLocation());
}
}



+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Touch.java View File

@@ -164,7 +164,7 @@ public class Touch extends Task {
+ "00:00:00 GMT).");
}
} catch (ParseException pe) {
throw new BuildException(pe.getMessage(), pe, location);
throw new BuildException(pe.getMessage(), pe, getLocation());
}
}

@@ -185,7 +185,7 @@ public class Touch extends Task {
fileUtils.createNewFile(file);
} catch (IOException ioe) {
throw new BuildException("Could not create " + file, ioe,
location);
getLocation());
}
}
}


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

@@ -112,7 +112,7 @@ public class Tstamp extends Task {
Enumeration i = customFormats.elements();
while (i.hasMoreElements()) {
CustomFormat cts = (CustomFormat) i.nextElement();
cts.execute(getProject(), d, location);
cts.execute(getProject(), d, getLocation());
}

SimpleDateFormat dstamp = new SimpleDateFormat ("yyyyMMdd");


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

@@ -116,15 +116,15 @@ public abstract class Unpack extends Task {

private void validate() throws BuildException {
if (source == null) {
throw new BuildException("No Src specified", location);
throw new BuildException("No Src specified", getLocation());
}

if (!source.exists()) {
throw new BuildException("Src doesn't exist", location);
throw new BuildException("Src doesn't exist", getLocation());
}

if (source.isDirectory()) {
throw new BuildException("Cannot expand a directory", location);
throw new BuildException("Cannot expand a directory", getLocation());
}

if (dest == null) {


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

@@ -130,7 +130,7 @@ public class Untar extends Expand {

} catch (IOException ioe) {
throw new BuildException("Error while expanding " + srcF.getPath(),
ioe, location);
ioe, getLocation());
} finally {
if (tis != null) {
try {


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/UpToDate.java View File

@@ -154,7 +154,7 @@ public class UpToDate extends Task implements Condition {
public Mapper createMapper() throws BuildException {
if (mapperElement != null) {
throw new BuildException("Cannot define more than one mapper",
location);
getLocation());
}
mapperElement = new Mapper(getProject());
return mapperElement;
@@ -225,7 +225,7 @@ public class UpToDate extends Task implements Condition {
public void execute() throws BuildException {
if (_property == null) {
throw new BuildException("property attribute is required.",
location);
getLocation());
}
boolean upToDate = eval();
if (upToDate) {


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

@@ -164,7 +164,7 @@ public class War extends Jar {
throws IOException, BuildException {
// If no webxml file is specified, it's an error.
if (deploymentDescriptor == null && !isInUpdateMode()) {
throw new BuildException("webxml attribute is required", location);
throw new BuildException("webxml attribute is required", getLocation());
}

super.initZipOutputStream(zOut);


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

@@ -188,7 +188,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
String[] dirs;

if (xslFile == null) {
throw new BuildException("no stylesheet specified", location);
throw new BuildException("no stylesheet specified", getLocation());
}

try {


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/Zip.java View File

@@ -433,7 +433,7 @@ public class Zip extends MatchingTask {
}
}

throw new BuildException(msg, ioe, location);
throw new BuildException(msg, ioe, getLocation());
} finally {
cleanUp();
}
@@ -586,7 +586,7 @@ public class Zip extends MatchingTask {
} catch (IOException ioe) {
throw new BuildException("Could not create empty ZIP archive "
+ "(" + ioe.getMessage() + ")", ioe,
location);
getLocation());
} finally {
if (os != null) {
try {
@@ -620,7 +620,7 @@ public class Zip extends MatchingTask {
} else if (emptyBehavior.equals("fail")) {
throw new BuildException("Cannot create " + archiveType
+ " archive " + zipFile +
": no files were included.", location);
": no files were included.", getLocation());
} else {
// Create.
return createEmptyZip(zipFile);
@@ -629,7 +629,7 @@ public class Zip extends MatchingTask {
for (int i = 0; i < files.length; ++i) {
if (files[i].equals(zipFile)) {
throw new BuildException("A zip file cannot include "
+ "itself", location);
+ "itself", getLocation());
}
}

@@ -793,7 +793,7 @@ public class Zip extends MatchingTask {
throws IOException {
if (file.equals(zipFile)) {
throw new BuildException("A zip file cannot include itself",
location);
getLocation());
}

FileInputStream fIn = new FileInputStream(file);


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

@@ -273,7 +273,7 @@ public class ANTLR extends Task {
log(commandline.describeCommand(), Project.MSG_VERBOSE);
int err = run(commandline.getCommandline());
if (err == 1) {
throw new BuildException("ANTLR returned: " + err, location);
throw new BuildException("ANTLR returned: " + err, getLocation());
}
} else {
log("Skipped grammar file. Generated file is newer.", Project.MSG_VERBOSE);
@@ -364,7 +364,7 @@ public class ANTLR extends Task {
try {
return exe.execute();
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
}
}

+ 7
- 7
src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java View File

@@ -248,7 +248,7 @@ public class EchoProperties extends Task {
if (inFile.exists() && inFile.isDirectory()) {
String message = "srcfile is a directory!";
if (failonerror) {
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
} else {
log(message, Project.MSG_ERR);
}
@@ -258,7 +258,7 @@ public class EchoProperties extends Task {
if (inFile.exists() && !inFile.canRead()) {
String message = "Can not read from the specified srcfile!";
if (failonerror) {
throw new BuildException( message, location );
throw new BuildException( message, getLocation() );
} else {
log( message, Project.MSG_ERR );
}
@@ -275,7 +275,7 @@ public class EchoProperties extends Task {
String message =
"Could not find file " + inFile.getAbsolutePath();
if (failonerror) {
throw new BuildException(message, fnfe, location);
throw new BuildException(message, fnfe, getLocation());
} else {
log( message, Project.MSG_WARN );
}
@@ -284,7 +284,7 @@ public class EchoProperties extends Task {
String message =
"Could not read file " + inFile.getAbsolutePath();
if (failonerror) {
throw new BuildException(message, ioe, location);
throw new BuildException(message, ioe, getLocation());
} else {
log( message, Project.MSG_WARN );
}
@@ -308,7 +308,7 @@ public class EchoProperties extends Task {
if (destfile.exists() && destfile.isDirectory()) {
String message = "destfile is a directory!";
if (failonerror) {
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
} else {
log(message, Project.MSG_ERR);
}
@@ -319,7 +319,7 @@ public class EchoProperties extends Task {
String message =
"Can not write to the specified destfile!";
if (failonerror) {
throw new BuildException(message, location);
throw new BuildException(message, getLocation());
} else {
log(message, Project.MSG_ERR);
}
@@ -330,7 +330,7 @@ public class EchoProperties extends Task {
}
} catch (IOException ioe) {
if (failonerror) {
throw new BuildException(ioe, location);
throw new BuildException(ioe, getLocation());
} else {
log(ioe.getMessage(), Project.MSG_INFO);
}


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

@@ -654,22 +654,22 @@ public class IContract extends MatchingTask {
/** Checks that the required attributes are set. */
private void preconditions() throws BuildException {
if (srcDir == null) {
throw new BuildException("srcdir attribute must be set!", location);
throw new BuildException("srcdir attribute must be set!", getLocation());
}
if (!srcDir.exists()) {
throw new BuildException("srcdir \"" + srcDir.getPath() + "\" does not exist!", location);
throw new BuildException("srcdir \"" + srcDir.getPath() + "\" does not exist!", getLocation());
}
if (instrumentDir == null) {
throw new BuildException("instrumentdir attribute must be set!", location);
throw new BuildException("instrumentdir attribute must be set!", getLocation());
}
if (repositoryDir == null) {
throw new BuildException("repositorydir attribute must be set!", location);
throw new BuildException("repositorydir attribute must be set!", getLocation());
}
if (updateIcontrol == true && classDir == null) {
throw new BuildException("classdir attribute must be specified when updateicontrol=true!", location);
throw new BuildException("classdir attribute must be specified when updateicontrol=true!", getLocation());
}
if (updateIcontrol == true && controlFile == null) {
throw new BuildException("controlfile attribute must be specified when updateicontrol=true!", location);
throw new BuildException("controlfile attribute must be specified when updateicontrol=true!", getLocation());
}
}



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

@@ -283,19 +283,19 @@ public class Javah extends Task {
// first off, make sure that we've got a srcdir

if ((cls == null) && (classes.size() == 0)) {
throw new BuildException("class attribute must be set!", location);
throw new BuildException("class attribute must be set!", getLocation());
}

if ((cls != null) && (classes.size() > 0)) {
throw new BuildException("set class attribute or class element, not both.", location);
throw new BuildException("set class attribute or class element, not both.", getLocation());
}

if (destDir != null) {
if (!destDir.isDirectory()) {
throw new BuildException("destination directory \"" + destDir + "\" does not exist or is not a directory", location);
throw new BuildException("destination directory \"" + destDir + "\" does not exist or is not a directory", getLocation());
}
if (outputFile != null) {
throw new BuildException("destdir and outputFile are mutually exclusive", location);
throw new BuildException("destdir and outputFile are mutually exclusive", getLocation());
}
}

@@ -350,7 +350,7 @@ public class Javah extends Task {
if (ex instanceof BuildException) {
throw (BuildException) ex;
} else {
throw new BuildException("Error starting javah: " + ex, ex, location);
throw new BuildException("Error starting javah: " + ex, ex, getLocation());
}
}
}
@@ -396,7 +396,7 @@ public class Javah extends Task {

if (stubs) {
if (!old) {
throw new BuildException("stubs only available in old mode.", location);
throw new BuildException("stubs only available in old mode.", getLocation());
}
cmd.createArgument().setValue("-stubs");
}


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

@@ -140,7 +140,7 @@ public class Native2Ascii extends MatchingTask {
public Mapper createMapper() throws BuildException {
if (mapper != null) {
throw new BuildException("Cannot define more than one mapper",
location);
getLocation());
}
mapper = new Mapper(getProject());
return mapper;


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

@@ -235,7 +235,7 @@ public class PropertyFile extends Task {

private void checkParameters() throws BuildException {
if (!checkParam(propertyfile)) {
throw new BuildException("file token must not be null.", location);
throw new BuildException("file token must not be null.", getLocation());
}
}

@@ -270,12 +270,12 @@ public class PropertyFile extends Task {
properties.save(bos, comment);
} catch (InvocationTargetException ite) {
Throwable t = ite.getTargetException();
throw new BuildException(t, location);
throw new BuildException(t, getLocation());
} catch (IllegalAccessException iae) {
// impossible
throw new BuildException(iae, location);
throw new BuildException(iae, getLocation());
} catch (IOException ioe) {
throw new BuildException(ioe, location);
throw new BuildException(ioe, getLocation());
} finally {
if (bos != null) {
try {


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

@@ -152,7 +152,7 @@ public class RenameExtensions extends MatchingTask {
Project.MSG_INFO);

Move move = (Move) getProject().createTask("move");
move.setOwningTarget(target);
move.setOwningTarget(getOwningTarget());
move.setTaskName(getTaskName());
move.setLocation(getLocation());
move.setTodir(srcDir);


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

@@ -150,7 +150,7 @@ public class Rpm extends Task {
try {
outputstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(output)));
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
} else {
outputstream = new LogOutputStream(this, Project.MSG_INFO);
@@ -159,7 +159,7 @@ public class Rpm extends Task {
try {
errorstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(error)));
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
} else {
errorstream = new LogOutputStream(this, Project.MSG_WARN);
@@ -180,7 +180,7 @@ public class Rpm extends Task {
exe.execute();
log("Building the RPM based on the " + specFile + " file");
} catch (IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
} finally {
if (output != null) {
try {
@@ -218,7 +218,7 @@ public class Rpm extends Task {
*/
public void setSpecFile(String sf) {
if ((sf == null) || (sf.trim().equals(""))) {
throw new BuildException("You must specify a spec file", location);
throw new BuildException("You must specify a spec file", getLocation());
}
this.specFile = sf;
}


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCheck.java View File

@@ -149,7 +149,7 @@ public class CCMCheck extends Continuus {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java View File

@@ -110,7 +110,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler {
result = run(commandLine, this);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

//create task ok, set this task as the default one
@@ -124,7 +124,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler {
result = run(commandLine2);
if (result != 0) {
String msg = "Failed executing: " + commandLine2.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

}


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMReconfigure.java View File

@@ -98,7 +98,7 @@ public class CCMReconfigure extends Continuus {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java View File

@@ -130,7 +130,7 @@ public abstract class Continuus extends Task {
exe.setCommandline(cmd.getCommandline());
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckin.java View File

@@ -146,7 +146,7 @@ public class CCCheckin extends ClearCase {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java View File

@@ -158,7 +158,7 @@ public class CCCheckout extends ClearCase {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCUnCheckout.java View File

@@ -116,7 +116,7 @@ public class CCUnCheckout extends ClearCase {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCUpdate.java View File

@@ -151,7 +151,7 @@ public class CCUpdate extends ClearCase {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java View File

@@ -134,7 +134,7 @@ public abstract class ClearCase extends Task {
exe.setCommandline(cmd.getCommandline());
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
}



+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java View File

@@ -638,14 +638,14 @@ public class Depend extends MatchingTask {
try {
long start = System.currentTimeMillis();
if (srcPath == null) {
throw new BuildException("srcdir attribute must be set",
location);
throw new BuildException("srcdir attribute must be set",
getLocation());
}

srcPathList = srcPath.list();
if (srcPathList.length == 0) {
throw new BuildException("srcdir attribute must be non-empty",
location);
throw new BuildException("srcdir attribute must be non-empty",
getLocation());
}

if (destPath == null) {


+ 11
- 11
src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java View File

@@ -239,34 +239,34 @@ public class IPlanetEjbcTask extends Task {
if (ejbdescriptor == null) {
String msg = "The standard EJB descriptor must be specified using "
+ "the \"ejbdescriptor\" attribute.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile())) {
String msg = "The standard EJB descriptor (" + ejbdescriptor
+ ") was not found or isn't a file.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

if (iasdescriptor == null) {
String msg = "The iAS-speific XML descriptor must be specified using"
+ " the \"iasdescriptor\" attribute.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
if ((!iasdescriptor.exists()) || (!iasdescriptor.isFile())) {
String msg = "The iAS-specific XML descriptor (" + iasdescriptor
+ ") was not found or isn't a file.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

if (dest == null) {
String msg = "The destination directory must be specified using "
+ "the \"dest\" attribute.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
if ((!dest.exists()) || (!dest.isDirectory())) {
String msg = "The destination directory (" + dest + ") was not "
+ "found or isn't a directory.";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

if ((iashome != null) && (!iashome.isDirectory())) {
@@ -291,10 +291,10 @@ public class IPlanetEjbcTask extends Task {
saxParser = saxParserFactory.newSAXParser();
} catch (SAXException e) {
String msg = "Unable to create a SAXParser: " + e.getMessage();
throw new BuildException(msg, e, location);
throw new BuildException(msg, e, getLocation());
} catch (ParserConfigurationException e) {
String msg = "Unable to create a SAXParser: " + e.getMessage();
throw new BuildException(msg, e, location);
throw new BuildException(msg, e, getLocation());
}

return saxParser;
@@ -325,15 +325,15 @@ public class IPlanetEjbcTask extends Task {
} catch (IOException e) {
String msg = "An IOException occurred while trying to read the XML "
+ "descriptor file: " + e.getMessage();
throw new BuildException(msg, e, location);
throw new BuildException(msg, e, getLocation());
} catch (SAXException e) {
String msg = "A SAXException occurred while trying to read the XML "
+ "descriptor file: " + e.getMessage();
throw new BuildException(msg, e, location);
throw new BuildException(msg, e, getLocation());
} catch (IPlanetEjbc.EjbcException e) {
String msg = "An exception occurred while trying to run the ejbc "
+ "utility: " + e.getMessage();
throw new BuildException(msg, e, location);
throw new BuildException(msg, e, getLocation());
}
}



+ 9
- 9
src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java View File

@@ -248,29 +248,29 @@ public class Translate extends MatchingTask {
public void execute() throws BuildException {
if (bundle == null) {
throw new BuildException("The bundle attribute must be set.",
location);
getLocation());
}

if (startToken == null) {
throw new BuildException("The starttoken attribute must be set.",
location);
getLocation());
}

if (startToken.length() != 1) {
throw new BuildException(
"The starttoken attribute must be a single character.",
location);
getLocation());
}

if (endToken == null) {
throw new BuildException("The endtoken attribute must be set.",
location);
getLocation());
}

if (endToken.length() != 1) {
throw new BuildException(
"The endtoken attribute must be a single character.",
location);
getLocation());
}

if (bundleLanguage == null) {
@@ -289,7 +289,7 @@ public class Translate extends MatchingTask {

if (toDir == null) {
throw new BuildException("The todir attribute must be set.",
location);
getLocation());
}

if (!toDir.exists()) {
@@ -405,7 +405,7 @@ public class Translate extends MatchingTask {
//have been scanned for and still not able to
//find a single resrouce file, throw exception
if (!loaded && checkLoaded) {
throw new BuildException(ioe.getMessage(), location);
throw new BuildException(ioe.getMessage(), getLocation());
}
}
}
@@ -463,7 +463,7 @@ public class Translate extends MatchingTask {
in.close();
}
} catch (IOException ioe) {
throw new BuildException(ioe.getMessage(), location);
throw new BuildException(ioe.getMessage(), getLocation());
}
}

@@ -579,7 +579,7 @@ outer: while (true) {
Project.MSG_VERBOSE);
}
} catch (IOException ioe) {
throw new BuildException(ioe.getMessage(), location);
throw new BuildException(ioe.getMessage(), getLocation());
}
}
}


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java View File

@@ -303,7 +303,7 @@ public class JDependTask extends Task {
if (errorOccurred) {
if (getHaltonerror()) {
throw new BuildException("JDepend failed",
location);
getLocation());
} else {
log("JDepend FAILED", Project.MSG_ERR);
}
@@ -426,7 +426,7 @@ public class JDependTask extends Task {
try {
return execute.execute();
} catch (IOException e) {
throw new BuildException("Process fork failed.", e, location);
throw new BuildException("Process fork failed.", e, getLocation());
}
}



+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java View File

@@ -177,7 +177,7 @@ public class JlinkTask extends MatchingTask {
try {
linker.link();
} catch (Exception ex) {
throw new BuildException(ex, location);
throw new BuildException(ex, getLocation());
}
}



+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java View File

@@ -402,19 +402,19 @@ public class JspC extends MatchingTask {
// first off, make sure that we've got a srcdir
if (src == null) {
throw new BuildException("srcdir attribute must be set!",
location);
getLocation());
}
String [] list = src.list();
if (list.length == 0) {
throw new BuildException("srcdir attribute must be set!",
location);
getLocation());
}

if (destDir != null && !destDir.isDirectory()) {
throw new
BuildException("destination directory \"" + destDir +
"\" does not exist or is not a directory",
location);
getLocation());
}

File dest = getActualDestDir();
@@ -441,7 +441,7 @@ public class JspC extends MatchingTask {
File srcDir = (File) getProject().resolveFile(list[i]);
if (!srcDir.exists()) {
throw new BuildException("srcdir \"" + srcDir.getPath() +
"\" does not exist!", location);
"\" does not exist!", getLocation());
}
DirectoryScanner ds = this.getDirectoryScanner(srcDir);
String[] files = ds.getIncludedFiles();
@@ -497,7 +497,7 @@ public class JspC extends MatchingTask {
// finally, lets execute the compiler!!
if (!compiler.execute()) {
if (failOnError) {
throw new BuildException(FAIL_MSG, location);
throw new BuildException(FAIL_MSG, getLocation());
} else {
log(FAIL_MSG, Project.MSG_ERR);
}


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

@@ -139,7 +139,7 @@ public class WLJspc extends MatchingTask {
}

if (destinationPackage == null) {
throw new BuildException("package attribute must be present.", location);
throw new BuildException("package attribute must be present.", getLocation());
}


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -566,7 +566,7 @@ public class JUnitTask extends Task {
if ((errorOccurredHere && test.getHaltonerror())
|| (failureOccurredHere && test.getHaltonfailure())) {
throw new BuildException("Test " + test.getName() + " failed"
+ (wasKilled ? " (timeout)" : ""), location);
+ (wasKilled ? " (timeout)" : ""), getLocation());
} else {
log("TEST " + test.getName() + " FAILED"
+ (wasKilled ? " (timeout)" : ""), Project.MSG_ERR);
@@ -651,7 +651,7 @@ public class JUnitTask extends Task {
} catch (java.io.IOException e) {
propsFile.delete();
throw new BuildException("Error creating temporary properties "
+ "file.", e, location);
+ "file.", e, getLocation());
}

Execute execute = new Execute(new LogStreamHandler(this,
@@ -679,7 +679,7 @@ public class JUnitTask extends Task {
try {
retVal = execute.execute();
} catch (IOException e) {
throw new BuildException("Process fork failed.", e, location);
throw new BuildException("Process fork failed.", e, getLocation());
} finally {
if (!propsFile.delete()) {
throw new BuildException("Could not delete temporary "


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java View File

@@ -144,7 +144,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
} catch (java.io.IOException e) {
String msg = "Failed executing: " + cmd.toString()
+ ". Exception: " + e.getMessage();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -231,7 +231,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
if (result != 0 && !ignorerc) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

if (!tmp.exists()) {
@@ -278,21 +278,21 @@ public class Pvcs extends org.apache.tools.ant.Task {
if (result != 0 && !ignorerc) {
String msg = "Failed executing: " + commandLine.toString()
+ ". Return code was " + result;
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

} catch (FileNotFoundException e) {
String msg = "Failed executing: " + commandLine.toString()
+ ". Exception: " + e.getMessage();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
} catch (IOException e) {
String msg = "Failed executing: " + commandLine.toString()
+ ". Exception: " + e.getMessage();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
} catch (ParseException e) {
String msg = "Failed executing: " + commandLine.toString()
+ ". Exception: " + e.getMessage();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
} finally {
if (tmp != null) {
tmp.delete();


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java View File

@@ -464,7 +464,7 @@ public abstract class SOS extends Task {
if (!done) {
String msg = "Directory " + localPath + " creation was not " +
"successful for an unknown reason";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
getProject().log("Created dir: " + dir.getAbsolutePath());
}
@@ -491,7 +491,7 @@ public abstract class SOS extends Task {
exe.setCommandline(cmd.getCommandline());
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
}
}


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckin.java View File

@@ -161,7 +161,7 @@ public class SOSCheckin extends SOS {
if (result == 255) {
// This is the exit status
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -200,13 +200,13 @@ public class SOSCheckin extends SOS {
}
// SOS server address is required
if (getSosServerPath() == null) {
throw new BuildException("sosserverpath attribute must be set!", location);
throw new BuildException("sosserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER);
commandLine.createArgument().setValue(getSosServerPath());
// Login info is required
if (getUsername() == null) {
throw new BuildException("username attribute must be set!", location);
throw new BuildException("username attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME);
commandLine.createArgument().setValue(getUsername());
@@ -216,13 +216,13 @@ public class SOSCheckin extends SOS {
commandLine.createArgument().setValue(getPassword());
// VSS Info is required
if (getVssServerPath() == null) {
throw new BuildException("vssserverpath attribute must be set!", location);
throw new BuildException("vssserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER);
commandLine.createArgument().setValue(getVssServerPath());
// VSS project is required
if (getProjectPath() == null) {
throw new BuildException("projectpath attribute must be set!", location);
throw new BuildException("projectpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT);
commandLine.createArgument().setValue(getProjectPath());


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckout.java View File

@@ -157,7 +157,7 @@ public class SOSCheckout extends SOS {
if (result == 255) {
// This is the exit status
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -195,13 +195,13 @@ public class SOSCheckout extends SOS {
}
// SOS server address is required
if (getSosServerPath() == null) {
throw new BuildException("sosserverpath attribute must be set!", location);
throw new BuildException("sosserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER);
commandLine.createArgument().setValue(getSosServerPath());
// Login info is required
if (getUsername() == null) {
throw new BuildException("username attribute must be set!", location);
throw new BuildException("username attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME);
commandLine.createArgument().setValue(getUsername());
@@ -211,13 +211,13 @@ public class SOSCheckout extends SOS {
commandLine.createArgument().setValue(getPassword());
// VSS Info is required
if (getVssServerPath() == null) {
throw new BuildException("vssserverpath attribute must be set!", location);
throw new BuildException("vssserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER);
commandLine.createArgument().setValue(getVssServerPath());
// VSS project is required
if (getProjectPath() == null) {
throw new BuildException("projectpath attribute must be set!", location);
throw new BuildException("projectpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT);
commandLine.createArgument().setValue(getProjectPath());


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSGet.java View File

@@ -168,7 +168,7 @@ public class SOSGet extends SOS {
if (result == 255) {
// This is the exit status
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -217,13 +217,13 @@ public class SOSGet extends SOS {
}
// SOS server address is required
if (getSosServerPath() == null) {
throw new BuildException("sosserverpath attribute must be set!", location);
throw new BuildException("sosserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER);
commandLine.createArgument().setValue(getSosServerPath());
// Login info is required
if (getUsername() == null) {
throw new BuildException("username attribute must be set!", location);
throw new BuildException("username attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME);
commandLine.createArgument().setValue(getUsername());
@@ -233,13 +233,13 @@ public class SOSGet extends SOS {
commandLine.createArgument().setValue(getPassword());
// VSS Info is required
if (getVssServerPath() == null) {
throw new BuildException("vssserverpath attribute must be set!", location);
throw new BuildException("vssserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER);
commandLine.createArgument().setValue(getVssServerPath());
// SS project path is required
if (getProjectPath() == null) {
throw new BuildException("projectpath attribute must be set!", location);
throw new BuildException("projectpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT);
commandLine.createArgument().setValue(getProjectPath());


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/optional/sos/SOSLabel.java View File

@@ -135,7 +135,7 @@ public class SOSLabel extends SOS {
if (result == 255) {
// This is the exit status
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -156,13 +156,13 @@ public class SOSLabel extends SOS {
commandLine.createArgument().setValue(SOSCmd.COMMAND_LABEL);
// SOS server address is required
if (getSosServerPath() == null) {
throw new BuildException("sosserverpath attribute must be set!", location);
throw new BuildException("sosserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER);
commandLine.createArgument().setValue(getSosServerPath());
// Login info is required
if (getUsername() == null) {
throw new BuildException("username attribute must be set!", location);
throw new BuildException("username attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME);
commandLine.createArgument().setValue(getUsername());
@@ -172,19 +172,19 @@ public class SOSLabel extends SOS {
commandLine.createArgument().setValue(getPassword());
// VSS Info is required
if (getVssServerPath() == null) {
throw new BuildException("vssserverpath attribute must be set!", location);
throw new BuildException("vssserverpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER);
commandLine.createArgument().setValue(getVssServerPath());
// SS project path is required
if (getProjectPath() == null) {
throw new BuildException("projectpath attribute must be set!", location);
throw new BuildException("projectpath attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT);
commandLine.createArgument().setValue(getProjectPath());
// a label is required
if (getLabel() == null) {
throw new BuildException("label attribute must be set!", location);
throw new BuildException("label attribute must be set!", getLocation());
}
commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL);
commandLine.createArgument().setValue(getLabel());


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java View File

@@ -192,7 +192,7 @@ public abstract class MSVSS extends Task {
exe.setCommandline(cmd.getCommandline());
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, location);
throw new BuildException(e, getLocation());
}
}



+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSADD.java View File

@@ -86,7 +86,7 @@ public class MSVSSADD extends MSVSS {
// first off, make sure that we've got a command and a localPath ...
if (getLocalPath() == null) {
String msg = "localPath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -113,7 +113,7 @@ public class MSVSSADD extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java View File

@@ -88,7 +88,7 @@ public class MSVSSCHECKIN extends MSVSS {
// first off, make sure that we've got a command and a vssdir ...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -117,7 +117,7 @@ public class MSVSSCHECKIN extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -145,7 +145,7 @@ public class MSVSSCHECKIN extends MSVSS {
String msg = "Directory " + m_LocalPath
+ " creation was not "
+ "succesful for an unknown reason";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
getProject().log("Created dir: " + dir.getAbsolutePath());
}


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java View File

@@ -90,7 +90,7 @@ public class MSVSSCHECKOUT extends MSVSS {
// first off, make sure that we've got a command and a vssdir ...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -117,7 +117,7 @@ public class MSVSSCHECKOUT extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -144,7 +144,7 @@ public class MSVSSCHECKOUT extends MSVSS {
if (!done) {
String msg = "Directory " + m_LocalPath + " creation was not " +
"succesful for an unknown reason";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
getProject().log("Created dir: " + dir.getAbsolutePath());
}


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCP.java View File

@@ -83,7 +83,7 @@ public class MSVSSCP extends MSVSS {
// first off, make sure that we've got a command and a vssdir ...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -104,7 +104,7 @@ public class MSVSSCP extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}



+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCREATE.java View File

@@ -137,7 +137,7 @@ public class MSVSSCREATE extends MSVSS {
// first off, make sure that we've got a command and a vssdir...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -166,7 +166,7 @@ public class MSVSSCREATE extends MSVSS {
result = run(commandLine);
if (result != 0 && m_FailOnError) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

}


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java View File

@@ -153,7 +153,7 @@ public class MSVSSGET extends MSVSS {
// first off, make sure that we've got a command and a vssdir ...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -184,7 +184,7 @@ public class MSVSSGET extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
}

@@ -211,7 +211,7 @@ public class MSVSSGET extends MSVSS {
if (!done) {
String msg = "Directory " + m_LocalPath + " creation was not " +
"successful for an unknown reason";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
getProject().log("Created dir: " + dir.getAbsolutePath());
}


+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSHISTORY.java View File

@@ -107,7 +107,7 @@ public class MSVSSHISTORY extends MSVSS {
// first off, make sure that we've got a command and a vssdir and a label ...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -150,7 +150,7 @@ public class MSVSSHISTORY extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

}
@@ -252,7 +252,7 @@ public class MSVSSHISTORY extends MSVSS {
startDate = calcDate(m_ToDate, m_NumDays);
} catch (ParseException ex) {
String msg = "Error parsing date: " + m_ToDate;
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
cmd.createArgument().setValue(FLAG_VERSION_DATE + m_ToDate + VALUE_FROMDATE + startDate);
} else if (m_FromDate != null && m_NumDays != Integer.MIN_VALUE) {
@@ -261,7 +261,7 @@ public class MSVSSHISTORY extends MSVSS {
endDate = calcDate(m_FromDate, m_NumDays);
} catch (ParseException ex) {
String msg = "Error parsing date: " + m_FromDate;
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
cmd.createArgument().setValue(FLAG_VERSION_DATE + endDate + VALUE_FROMDATE + m_FromDate);
} else {


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java View File

@@ -133,11 +133,11 @@ public class MSVSSLABEL extends MSVSS {
// first off, make sure that we've got a command and a vssdir and a label ...
if (getVsspath() == null) {
String msg = "vsspath attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}
if (getLabel() == null) {
String msg = "label attribute must be set!";
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

// now look for illegal combinations of things ...
@@ -171,7 +171,7 @@ public class MSVSSLABEL extends MSVSS {
result = run(commandLine);
if (result != 0) {
String msg = "Failed executing: " + commandLine.toString();
throw new BuildException(msg, location);
throw new BuildException(msg, getLocation());
}

}


Loading…
Cancel
Save