bodewig     01/11/09 05:08:15

  Modified:    src/main/org/apache/tools/ant/util/regexp RegexpFactory.java
  Removed:     src/main/org/apache/tools/ant/util/regexp
                        MatcherWrappedAsRegexp.java
               src/testcases/org/apache/tools/ant/util/regexp
                        MatcherWrappedAsRegexpTest.java
  Log:
  don't try to do too much with the regexp stuff.
  
  Revision  Changes    Path
  1.3       +12 -2     
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
  
  Index: RegexpFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RegexpFactory.java        2001/10/26 09:36:40     1.2
  +++ RegexpFactory.java        2001/11/09 13:08:15     1.3
  @@ -62,6 +62,7 @@
    * <code>ant.regexp.regexpimpl</code>.
    *
    * @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
  + * @version $Revision: 1.3 $
    */
   public class RegexpFactory extends RegexpMatcherFactory
   {
  @@ -110,12 +111,21 @@
           throw new BuildException("No supported regular expression matcher 
found");
       }
   
  -    protected Regexp createRegexpInstance(String classname) {
  +    /**
  +     * Wrapper over [EMAIL PROTECTED] RegexpMatcherFactory#createInstance
  +     * createInstance} that ensures that we are dealing with a Regexp
  +     * implementation.
  +     *
  +     * @since 1.3
  +     */
  +    protected Regexp createRegexpInstance(String classname) 
  +        throws BuildException {
  +
           RegexpMatcher m = createInstance(classname);
           if (m instanceof Regexp) {
               return (Regexp) m;
           } else {
  -            return new MatcherWrappedAsRegexp(m);
  +            throw new BuildException(classname + " doesn't implement the 
Regexp interface");
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to