/[classpath]/inetlib/source/gnu/inet/nntp/GroupIterator.java
ViewVC logotype

Diff of /inetlib/source/gnu/inet/nntp/GroupIterator.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by dog, Thu Nov 25 22:15:05 2004 UTC revision 1.7 by dog, Thu Aug 25 09:45:14 2005 UTC
# Line 39  Line 39 
39  package gnu.inet.nntp;  package gnu.inet.nntp;
40    
41  import java.io.IOException;  import java.io.IOException;
42    import java.net.ProtocolException;
43  import java.util.NoSuchElementException;  import java.util.NoSuchElementException;
44    
45  /**  /**
# Line 81  public class GroupIterator Line 82  public class GroupIterator
82      String line = nextLine();      String line = nextLine();
83    
84      // Parse line      // Parse line
85      int start = 0, end;      try
86      end = line.indexOf(' ', start);        {
87      String name = line.substring(start, end);          int start = 0, end;
88      start = end + 1;          end = line.indexOf(' ', start);
89      end = line.indexOf(' ', start);          if (end == -1)
90      int last = Integer.parseInt(line.substring(start, end));            return new Group(line, -1, -1, false);
91      start = end + 1;  
92      end = line.indexOf(' ', start);          String name = line.substring(start, end);
93      int first = Integer.parseInt(line.substring(start, end));          start = end + 1;
94      start = end + 1;          end = line.indexOf(' ', start);
95      boolean canPost = CAN_POST.equals(line.substring(start));          int last = Integer.parseInt(line.substring(start, end));
96            start = end + 1;
97            end = line.indexOf(' ', start);
98            int first = Integer.parseInt(line.substring(start, end));
99            start = end + 1;
100            boolean canPost = CAN_POST.equals(line.substring(start));
101    
102      return new Group(name, last, first, canPost);          return new Group(name, last, first, canPost);
103          }
104        catch (StringIndexOutOfBoundsException e)
105          {
106            ProtocolException e2 =
107              new ProtocolException("Invalid group line: " + line);
108            e2.initCause(e);
109            throw e2;
110          }
111    }    }
112    
113  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26