diff --git a/docs/manual/install.html b/docs/manual/install.html index 93942043f..af31b337e 100644 --- a/docs/manual/install.html +++ b/docs/manual/install.html @@ -288,7 +288,7 @@ Installing Ant / Optional Tasks section above.

jakarta.apache.org/regexp/ - jakarta-oro-2.0.4.jar + jakarta-oro-2.0.6.jar regexp type with mappers and the perforce tasks jakarta.apache.org/oro/ @@ -408,7 +408,7 @@ Installing Ant / Optional Tasks section above.



-

Copyright © 2000-2002 Apache Software Foundation. All rights +

Copyright © 2000-2003 Apache Software Foundation. All rights Reserved.

diff --git a/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java b/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java index 4af37ca39..38e6e6d94 100644 --- a/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java +++ b/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,14 +95,17 @@ public class RegexpFactory extends RegexpMatcherFactory { } try { + testAvailability("java.util.regex.Matcher"); return createRegexpInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp"); } catch (BuildException be) {} try { + testAvailability("org.apache.oro.text.regex.Pattern"); return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaOroRegexp"); } catch (BuildException be) {} try { + testAvailability("org.apache.regexp.RE"); return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaRegexpRegexp"); } catch (BuildException be) {} diff --git a/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java b/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java index 6d70bcbb0..9eab16b58 100644 --- a/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java +++ b/src/main/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,14 +100,17 @@ public class RegexpMatcherFactory { } try { + testAvailability("java.util.regex.Matcher"); return createInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher"); } catch (BuildException be) {} try { + testAvailability("org.apache.oro.text.regex.Pattern"); return createInstance("org.apache.tools.ant.util.regexp.JakartaOroMatcher"); } catch (BuildException be) {} try { + testAvailability("org.apache.regexp.RE"); return createInstance("org.apache.tools.ant.util.regexp.JakartaRegexpMatcher"); } catch (BuildException be) {} @@ -123,4 +126,12 @@ public class RegexpMatcherFactory { throw new BuildException(t); } } + + protected void testAvailability(String className) throws BuildException { + try { + Class implClass = Class.forName(className); + } catch (Throwable t) { + throw new BuildException(t); + } + } }