ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r808163 - in /ant/core/trunk: docs/manual/ docs/manual/CoreTypes/ src/main/org/apache/tools/ant/ src/main/org/apache/tools/ant/taskdefs/ src/main/org/apache/tools/ant/taskdefs/compilers/ src/main/org/apache/tools/ant/taskdefs/optional/ src/...
Date Wed, 26 Aug 2009 19:42:27 GMT
Author: jglick
Date: Wed Aug 26 19:42:25 2009
New Revision: 808163

URL: http://svn.apache.org/viewvc?rev=808163&view=rev
Log:
More cleanup of pre-1.4 code and docs.

Modified:
    ant/core/trunk/docs/manual/CoreTypes/mapper.html
    ant/core/trunk/docs/manual/CoreTypes/regexp.html
    ant/core/trunk/docs/manual/install.html
    ant/core/trunk/docs/manual/running.html
    ant/core/trunk/src/main/org/apache/tools/ant/Project.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/RegularExpression.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java

Modified: ant/core/trunk/docs/manual/CoreTypes/mapper.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/mapper.html?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/mapper.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/mapper.html Wed Aug 26 19:42:25 2009
@@ -373,8 +373,8 @@
 href="http://www.crocodile.org/~sts/Rex/" target="_top">gnu.rex</a> with Ant, see
<a
 href="http://marc.theaimsgroup.com/?l=ant-dev&m=97550753813481&w=2" target="_top">this</a>
 article.</p>
-<p>This means, you need one of the supported regular expression
-  libraries <strong>and</strong>
+<p>If you want to use one of the supported regular expression
+  libraries you need to also use
   the corresponding <code>ant-[jakarta-oro, jakarta-regexp, apache-oro, apache-regexp}.jar</code>
 from the Ant release you are using.
 Make sure, both will be loaded from the same
@@ -392,8 +392,7 @@
 name of the class implementing
 <code>org.apache.tools.ant.util.regexp.RegexpMatcher</code> that
 should be used.</li>
-<li>If it has not been set, first try the JDK 1.4 classes, then
-jakarta-ORO and finally try jakarta-regexp.</li>
+<li>If it has not been set, uses the JDK 1.4 classes.</li>
 </ul>
 
 <b>Examples:</b>

Modified: ant/core/trunk/docs/manual/CoreTypes/regexp.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/regexp.html?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/regexp.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/regexp.html Wed Aug 26 19:42:25 2009
@@ -78,8 +78,7 @@
 </li>
 </ul>
 It can also be another implementation of the interface <code>org.apache.tools.ant.util.regexp.Regexp</code>.
-If <code>ant.regexp.regexpimpl</code> is not defined, ant checks in the order
Jdk14Regexp, JakartaOroRegexp,
- JakartaRegexp for the availability of the corresponding library. The first of these 3 which
is found will be used.</p>
+If <code>ant.regexp.regexpimpl</code> is not defined, Ant uses Jdk14Regexp as
this is always available.</p>
 <p>
 There are cross-platform issues for matches related to line terminator.
 For example if you use $ to anchor your regular expression on the end of a line
@@ -88,7 +87,7 @@
 both Unix and Windows platforms before you rely on it.
 <ul>
     <li>Jakarta Oro defines a line terminator as '\n' and is consistent with Perl.</li>
-    <li>Jakarta RegExp uses a system-dependant line terminator.</li>
+    <li>Jakarta RegExp uses a system-dependent line terminator.</li>
     <li>JDK 1.4 uses '\n', '\r\n', '\u0085', '\u2028', '\u2029' as a default
     but is configured in the wrapper to use only '\n' (UNIX_LINE)</li>
 </ul>

Modified: ant/core/trunk/docs/manual/install.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/install.html?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/install.html (original)
+++ ant/core/trunk/docs/manual/install.html Wed Aug 26 19:42:25 2009
@@ -696,7 +696,7 @@
 if you are using the
 indicated feature. Note that only one of the regexp libraries is
 needed for use with the mappers
-(and Java 1.4 and higher includes a regexp implementation which
+(and Java includes a regexp implementation which
 Ant will find automatically).
 You will also need to install the particular
 Ant optional jar containing the task definitions to make these

Modified: ant/core/trunk/docs/manual/running.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/running.html?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/running.html (original)
+++ ant/core/trunk/docs/manual/running.html Wed Aug 26 19:42:25 2009
@@ -343,8 +343,7 @@
 <tr>
   <td><code>ant.regexp.regexpimpl</code></td>
   <td>classname</td>
-  <td>classname for a RegExp implementation; if not set Ant tries to
-      find another (JDK14+, Apache Oro...);
+  <td>classname for a RegExp implementation; if not set Ant uses JDK 1.4's implementation;
       <a href="CoreTypes/mapper.html#regexp-mapper">RegExp-Mapper</a>
       "Choice of regular expression implementation"
   </td>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Project.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Project.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Project.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Project.java Wed Aug 26 19:42:25 2009
@@ -918,9 +918,8 @@
         setPropertyInternal(MagicNames.ANT_JAVA_VERSION, javaVersion);
 
         // sanity check
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0)
-                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1))  {
-            throw new BuildException("Ant cannot work on Java 1.0 / 1.1");
+        if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_4))  {
+            throw new BuildException("Ant cannot work on Java prior to 1.4");
         }
         log("Detected Java version: " + javaVersion + " in: "
             + System.getProperty("java.home"), MSG_VERBOSE);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java Wed Aug 26 19:42:25 2009
@@ -136,11 +136,7 @@
     }
 
     private String assumedJavaVersion() {
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
-            return JAVAC12;
-        } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
-            return JAVAC13;
-        } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4)) {
+        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4)) {
             return JAVAC14;
         } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5)) {
             return JAVAC15;

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
Wed Aug 26 19:42:25 2009
@@ -98,13 +98,6 @@
     public static CompilerAdapter getCompiler(String compilerType, Task task,
                                               Path classpath)
         throws BuildException {
-            boolean isClassicCompilerSupported = true;
-            //as new versions of java come out, add them to this test
-            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
-                && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
-                isClassicCompilerSupported = false;
-            }
-
             if (compilerType.equalsIgnoreCase("jikes")) {
                 return new Jikes();
             }
@@ -114,15 +107,11 @@
             if (compilerType.equalsIgnoreCase("classic")
                 || compilerType.equalsIgnoreCase("javac1.1")
                 || compilerType.equalsIgnoreCase("javac1.2")) {
-                if (isClassicCompilerSupported) {
-                    return new Javac12();
-                } else {
-                    task.log("This version of java does "
-                                             + "not support the classic "
-                                             + "compiler; upgrading to modern",
-                                             Project.MSG_WARN);
-                    compilerType = "modern";
-                }
+                task.log("This version of java does "
+                                         + "not support the classic "
+                                         + "compiler; upgrading to modern",
+                                         Project.MSG_WARN);
+                compilerType = "modern";
             }
             //on java<=1.3 the modern falls back to classic if it is not found
             //but on java>=1.4 we just bail out early
@@ -135,22 +124,16 @@
                 if (doesModernCompilerExist()) {
                     return new Javac13();
                 } else {
-                    if (isClassicCompilerSupported) {
-                        task.log("Modern compiler not found - looking for "
-                                 + "classic compiler", Project.MSG_WARN);
-                        return new Javac12();
-                    } else {
-                        throw new BuildException("Unable to find a javac "
-                                                 + "compiler;\n"
-                                                 + MODERN_COMPILER
-                                                 + " is not on the "
-                                                 + "classpath.\n"
-                                                 + "Perhaps JAVA_HOME does not"
-                                                 + " point to the JDK.\n"
-                                + "It is currently set to \""
-                                + JavaEnvUtils.getJavaHome()
-                                + "\"");
-                    }
+                    throw new BuildException("Unable to find a javac "
+                                             + "compiler;\n"
+                                             + MODERN_COMPILER
+                                             + " is not on the "
+                                             + "classpath.\n"
+                                             + "Perhaps JAVA_HOME does not"
+                                             + " point to the JDK.\n"
+                            + "It is currently set to \""
+                            + JavaEnvUtils.getJavaHome()
+                            + "\"");
                 }
             }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Wed Aug 26 19:42:25 2009
@@ -554,11 +554,7 @@
      * @since Ant 1.5
      */
     protected boolean assumeJava12() {
-        return "javac1.2".equals(attributes.getCompilerVersion())
-            || ("classic".equals(attributes.getCompilerVersion())
-                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2))
-            || ("extJavac".equals(attributes.getCompilerVersion())
-                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2));
+        return "javac1.2".equals(attributes.getCompilerVersion());
     }
 
     /**
@@ -567,13 +563,7 @@
      * @since Ant 1.5
      */
     protected boolean assumeJava13() {
-        return "javac1.3".equals(attributes.getCompilerVersion())
-            || ("classic".equals(attributes.getCompilerVersion())
-                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3))
-            || ("modern".equals(attributes.getCompilerVersion())
-                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3))
-            || ("extJavac".equals(attributes.getCompilerVersion())
-                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3));
+        return "javac1.3".equals(attributes.getCompilerVersion());
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java Wed Aug 26
19:42:25 2009
@@ -34,6 +34,7 @@
  * was refactored.
  *
  * @since Ant 1.3
+ * @deprecated Use {@link Javac13} instead.
  */
 public class Javac12 extends DefaultCompilerAdapter {
     protected static final String CLASSIC_COMPILER_CLASSNAME = "sun.tools.javac.Main";

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java Wed
Aug 26 19:42:25 2009
@@ -58,15 +58,15 @@
  * <pre>
  * Available implementations:
  *
- *   org.apache.tools.ant.util.regexp.JakartaOroRegexp (the default if available)
+ *   org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (default)
+ *        Uses Java's built-in regular expression package
+ *
+ *   org.apache.tools.ant.util.regexp.JakartaOroRegexp
  *        Requires  the jakarta-oro package
  *
  *   org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
  *        Requires the jakarta-regexp package
  *
- *   org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (fallback default)
- *        Uses Java's built-in regular expression package
- *
  * Usage:
  *
  *   Call Syntax:

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/RegularExpression.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/RegularExpression.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/RegularExpression.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/RegularExpression.java Wed Aug 26 19:42:25
2009
@@ -33,14 +33,14 @@
  * <pre>
  * Available implementations:
  *
- *   org.apache.tools.ant.util.regexp.JakartaOroRegexp (the default if available)
+ *   org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (default)
+ *        Based on the JDK's built-in regular expression package
+ *
+ *   org.apache.tools.ant.util.regexp.JakartaOroRegexp
  *        Based on the jakarta-oro package
  *
  *   org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
  *        Based on the jakarta-regexp package
- *
- *   org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (fallback default)
- *        Based on the JDK's built-in regular expression package
  * </pre>
  *
  * <pre>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java Wed Aug 26 19:42:25
2009
@@ -17,7 +17,6 @@
  */
 package org.apache.tools.ant.util;
 
-import java.io.BufferedWriter;
 import java.io.File;
 import java.io.IOException;
 import java.io.FileWriter;
@@ -143,7 +142,7 @@
 
     /**
      * Returns the version of Java this class is running under.
-     * @return the version of Java as a String, e.g. "1.1"
+     * @return the version of Java as a String, e.g. "1.6"
      */
     public static String getJavaVersion() {
         return javaVersion;
@@ -164,8 +163,8 @@
      * Compares the current Java version to the passed in String -
      * assumes the argument is one of the constants defined in this
      * class.
-     * Note that Ant now requires JDK 1.2+ so {@link #JAVA_1_0} and
-     * {@link #JAVA_1_1} need no longer be tested for.
+     * Note that Ant now requires JDK 1.4+ so {@link #JAVA_1_0} through
+     * {@link #JAVA_1_3} need no longer be tested for.
      * @param version the version to check against the current version.
      * @return true if the version of Java is the same as the given version.
      * @since Ant 1.5
@@ -178,8 +177,8 @@
      * Compares the current Java version to the passed in String -
      * assumes the argument is one of the constants defined in this
      * class.
-     * Note that Ant now requires JDK 1.2+ so {@link #JAVA_1_0} and
-     * {@link #JAVA_1_1} need no longer be tested for.
+     * Note that Ant now requires JDK 1.4+ so {@link #JAVA_1_0} through
+     * {@link #JAVA_1_3} need no longer be tested for.
      * @param version the version to check against the current version.
      * @return true if the version of Java is the same or higher than the
      * given version.

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java Wed Aug 26
19:42:25 2009
@@ -21,7 +21,6 @@
 import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.util.ClasspathUtils;
-import org.apache.tools.ant.util.JavaEnvUtils;
 
 /***
  * Regular expression factory, which will create Regexp objects.  The
@@ -41,7 +40,7 @@
      * @throws BuildException on error
      */
     public Regexp newRegexp() throws BuildException {
-        return (Regexp) newRegexp(null);
+        return newRegexp(null);
     }
 
     /***
@@ -65,32 +64,7 @@
             //         load a different implementation?
         }
 
-        Throwable cause = null;
-
-        try {
-            testAvailability("java.util.regex.Matcher");
-            return createRegexpInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp");
-        } catch (BuildException be) {
-            cause = orCause(
-                cause, be,
-                JavaEnvUtils.getJavaVersionNumber() < JavaEnvUtils.VERSION_1_4);
-        }
-
-        try {
-            testAvailability("org.apache.oro.text.regex.Pattern");
-            return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaOroRegexp");
-        } catch (BuildException be) {
-            cause = orCause(cause, be, true);
-        }
-
-        try {
-            testAvailability("org.apache.regexp.RE");
-            return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaRegexpRegexp");
-        } catch (BuildException be) {
-            cause = orCause(cause, be, true);
-        }
-        throw new BuildException("No supported regular expression matcher found"
-                + (cause != null ? ": " + cause : ""), cause);
+        return new Jdk14RegexpRegexp();
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java Wed
Aug 26 19:42:25 2009
@@ -21,7 +21,6 @@
 import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.util.ClasspathUtils;
-import org.apache.tools.ant.util.JavaEnvUtils;
 
 /**
  * Simple Factory Class that produces an implementation of RegexpMatcher based on the system
@@ -68,40 +67,7 @@
             //         load a different implementation?
         }
 
-        Throwable cause = null;
-
-        try {
-            testAvailability("java.util.regex.Matcher");
-            return createInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher");
-        } catch (BuildException be) {
-            cause = orCause(
-                cause, be,
-                JavaEnvUtils.getJavaVersionNumber() < JavaEnvUtils.VERSION_1_4);
-        }
-
-        try {
-            testAvailability("org.apache.oro.text.regex.Pattern");
-            return createInstance("org.apache.tools.ant.util.regexp.JakartaOroMatcher");
-        } catch (BuildException be) {
-            cause = orCause(cause, be, true);
-        }
-
-        try {
-            testAvailability("org.apache.regexp.RE");
-            return createInstance("org.apache.tools.ant.util.regexp.JakartaRegexpMatcher");
-        } catch (BuildException be) {
-            cause = orCause(cause, be, true);
-        }
-        throw new BuildException("No supported regular expression matcher found"
-                + (cause != null ? ": " + cause : ""), cause);
-    }
-
-    static Throwable orCause(Throwable deflt, BuildException be, boolean ignoreCnfe) {
-        if (deflt != null) {
-            return deflt;
-        }
-        Throwable t = be.getException();
-        return ignoreCnfe && t instanceof ClassNotFoundException ? null : t;
+        return new Jdk14RegexpMatcher();
     }
 
     /**

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java Wed
Aug 26 19:42:25 2009
@@ -22,8 +22,6 @@
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.taskdefs.condition.Os;
-import org.apache.tools.ant.util.JavaEnvUtils;
 
 import junit.framework.TestCase;
 
@@ -98,12 +96,6 @@
 
     // test that the watchdog ends the process
     public void testTimeOutForked() throws Exception {
-        //process doesn't die properly under this combination,
-        //thus test fails.  No workaround?
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
-            && Os.isFamily("dos")) {
-            return;
-        }
         Commandline cmd = getCommandline(TIME_OUT*2);
         ej.setJavaCommand(cmd);
         long now = System.currentTimeMillis();

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java Wed Aug 26
19:42:25 2009
@@ -21,10 +21,8 @@
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter;
 import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory;
-import org.apache.tools.ant.taskdefs.compilers.Javac12;
 import org.apache.tools.ant.taskdefs.compilers.Javac13;
 import org.apache.tools.ant.taskdefs.compilers.JavacExternal;
-import org.apache.tools.ant.util.JavaEnvUtils;
 
 import junit.framework.TestCase;
 
@@ -189,23 +187,13 @@
     }
 
     public void testCompilerAdapter() {
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
-            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
-            javac.setCompiler("javac1.1");
-        } else {
-            javac.setCompiler("javac1.4");
-        }
+        javac.setCompiler("javac1.4");
 
         javac.setDepend(true);
         CompilerAdapter adapter =
             CompilerAdapterFactory.getCompiler(javac.getCompiler(), javac);
 
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
-            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
-            assertTrue(adapter instanceof Javac12);
-        } else {
-            assertTrue(adapter instanceof Javac13);
-        }
+        assertTrue(adapter instanceof Javac13);
 
         javac.setFork(true);
         adapter =

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java
Wed Aug 26 19:42:25 2009
@@ -20,7 +20,6 @@
 
 import org.apache.tools.ant.BuildFileTest;
 import org.apache.tools.ant.taskdefs.condition.Os;
-import org.apache.tools.ant.util.JavaEnvUtils;
 import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
 
 /**

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java
Wed Aug 26 19:42:25 2009
@@ -23,7 +23,6 @@
 
 import java.io.IOException;
 
-import org.apache.tools.ant.util.JavaEnvUtils;
 
 import junit.framework.TestCase;
 
@@ -40,10 +39,6 @@
     }
 
     public void testProcessDestroyer(){
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
-            return;
-        }
-
         try {
             ProcessDestroyer processDestroyer = new ProcessDestroyer();
             Process process =

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java?rev=808163&r1=808162&r2=808163&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java Wed
Aug 26 19:42:25 2009
@@ -22,7 +22,6 @@
 
 import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.Project;
-import org.apache.tools.ant.util.JavaEnvUtils;
 
 /**
  * JUnit 3 testcases for org.apache.tools.ant.CommandlineJava
@@ -143,11 +142,6 @@
     }
 
     public void testAssertions() throws Exception {
-        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
-            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
-            return;
-        }
-
         CommandlineJava c = new CommandlineJava();
         c.createArgument().setValue("org.apache.tools.ant.CommandlineJavaTest");
         c.setClassname("junit.textui.TestRunner");



Mime
View raw message