commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTPFileListParserImpl.java
Date Tue, 05 Aug 2003 18:07:03 GMT
dfs         2003/08/05 11:07:03

  Modified:    net/src/java/org/apache/commons/net/ftp
                        FTPFileListParserImpl.java
  Log:
  Made matcher protected so that subclasses may use it.
  
  Revision  Changes    Path
  1.3       +20 -8     jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParserImpl.java
  
  Index: FTPFileListParserImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParserImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FTPFileListParserImpl.java	6 Mar 2003 12:38:42 -0000	1.2
  +++ FTPFileListParserImpl.java	5 Aug 2003 18:07:03 -0000	1.3
  @@ -80,14 +80,18 @@
        * entry
        */
       private Pattern pattern = null;
  -    /**
  -     * internal PatternMatcher object used by the parser
  -     */
  -    private PatternMatcher matcher = null;
  +
       /**
        * internal match result used by the parser
        */
       private MatchResult result = null;
  +
  +    /**
  +     * Internal PatternMatcher object used by the parser.  It has protected
  +     * scope in case subclasses want to make use of it for their own purposes.
  +     */
  +    protected PatternMatcher _matcher_ = null;
  +
       
       /**
        * The constructor for a MatchApparatus object.
  @@ -106,8 +110,8 @@
       {
           try 
           {
  -            this.matcher = new Perl5Matcher();
  -            this.pattern = new Perl5Compiler().compile(regex);
  +            _matcher_ = new Perl5Matcher();
  +            pattern   = new Perl5Compiler().compile(regex);
           } 
           catch (MalformedPatternException e) 
           {
  @@ -150,9 +154,9 @@
       public boolean matches(String s)
       {
           this.result = null;
  -        if (matcher.matches(s.trim(), this.pattern))
  +        if (_matcher_.matches(s.trim(), this.pattern))
           {
  -            this.result = matcher.getMatch();
  +            this.result = _matcher_.getMatch();
           }
           return null != this.result;
       }
  @@ -225,3 +229,11 @@
           return reader.readLine();
       }
   }
  +
  +/* Emacs configuration
  + * Local variables:        **
  + * mode:             java  **
  + * c-basic-offset:   4     **
  + * indent-tabs-mode: nil   **
  + * End:                    **
  + */
  
  
  

Mime
View raw message