cvs commit: jakarta-oro/src/java/org/apache/oro/text/perl Perl5Util.java

[email protected]
Newsgroups gmane.comp.jakarta.oro.devel
Message-ID <[email protected]>
dfs         2002/11/13 16:37:08

  Modified:    .        CHANGES
               src/java/org/apache/oro/text/perl Perl5Util.java
  Log:
  PR: 14488
  Made Perl5Util.toString() return null if no match exists in keeping
  with the MatchResult interface.  Previously, a NullPointerException
  was being thrown.
  
  Revision  Changes    Path
  1.32      +5 -1      jakarta-oro/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/jakarta-oro/CHANGES,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- CHANGES	30 Oct 2002 17:49:10 -0000	1.31
  +++ CHANGES	14 Nov 2002 00:37:07 -0000	1.32
  @@ -1,6 +1,10 @@
   $Id$
   
   Version 2.0.7-dev-2
  + o Made Perl5Util.toString() return null if no match exists in keeping
  +   with the MatchResult interface.  Previously, a NullPointerException
  +   was being thrown.
  +
    o Fixed problem whereby an AwkMatchResult resulting from a match on an
      AwkStreamInput source (AwkMatcher.contains(AwkStreamInput, Pattern);)
      would contain offsets relative to the buffered input rather than to where
  
  
  
  1.14      +3 -1      jakarta-oro/src/java/org/apache/oro/text/perl/Perl5Util.java
  
  Index: Perl5Util.java
  ===================================================================
  RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/perl/Perl5Util.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Perl5Util.java	31 May 2002 03:17:43 -0000	1.13
  +++ Perl5Util.java	14 Nov 2002 00:37:08 -0000	1.14
  @@ -1086,6 +1086,8 @@
      * @return A string containing the entire match.
      */  
     public synchronized String toString() {
  +    if(__lastMatch == null)
  +      return null;
       return __lastMatch.toString();
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.