Browse Source

drop version check now that ant-nodeps.jar has been removed

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@948667 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
af5b94e9d9
2 changed files with 5 additions and 40 deletions
  1. +5
    -39
      src/main/org/apache/tools/ant/Diagnostics.java
  2. +0
    -1
      src/main/org/apache/tools/ant/Main.java

+ 5
- 39
src/main/org/apache/tools/ant/Diagnostics.java View File

@@ -72,7 +72,6 @@ public final class Diagnostics {
private static final int SECONDS_PER_MILLISECOND = 1000;
private static final int SECONDS_PER_MINUTE = 60;
private static final int MINUTES_PER_HOUR = 60;
private static final String TEST_CLASS = "org.apache.tools.ant.taskdefs.optional.EchoProperties";

/**
* The error text when a security manager blocks access to a property.
@@ -87,42 +86,19 @@ public final class Diagnostics {
}

/**
* Check if optional tasks are available. Not that it does not check
* for implementation version. Use <tt>validateVersion()</tt> for this.
* @return <tt>true</tt> if optional tasks are available.
* Doesn't do anything.
* @deprecated Obsolete since Ant 1.8.2
* @return <tt>true</tt>
*/
public static boolean isOptionalAvailable() {
try {
Class.forName(TEST_CLASS);
} catch (ClassNotFoundException e) {
return false;
}
return true;
}

/**
* Check if core and optional implementation version do match.
* @throws BuildException if the implementation version of optional tasks
* does not match the core implementation version.
* Doesn't do anything.
* @deprecated Obsolete since Ant 1.8.2
*/
public static void validateVersion() throws BuildException {
try {
Class optional = Class.forName(TEST_CLASS);
String coreVersion = getImplementationVersion(Main.class);
String optionalVersion = getImplementationVersion(optional);

if (coreVersion != null && !coreVersion.equals(optionalVersion)) {
throw new BuildException("Invalid implementation version "
+ "between Ant core and Ant optional tasks.\n"
+ " core : " + coreVersion + " in "
+ getClassLocation(Main.class)
+ "\n" + " optional: " + optionalVersion + " in "
+ getClassLocation(optional));
}
} catch (ClassNotFoundException e) {
// ignore
ignoreThrowable(e);
}
}

/**
@@ -332,16 +308,6 @@ public final class Diagnostics {
out.println("core tasks : " + getImplementationVersion(Main.class)
+ " in " + getClassLocation(Main.class));

Class optional = null;
try {
optional = Class.forName(TEST_CLASS);
out.println("optional tasks : " + getImplementationVersion(optional)
+ " in " + getClassLocation(optional));
} catch (ClassNotFoundException e) {
ignoreThrowable(e);
out.println("optional tasks : not available");
}

header(out, "ANT PROPERTIES");
doReportAntProperties(out);



+ 0
- 1
src/main/org/apache/tools/ant/Main.java View File

@@ -193,7 +193,6 @@ public class Main implements AntMain {
ClassLoader coreLoader) {

try {
Diagnostics.validateVersion();
processArgs(args);
} catch (Throwable exc) {
handleLogfile();


Loading…
Cancel
Save