You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by hb...@apache.org on 2001/11/18 02:12:22 UTC
cvs commit: jakarta-james/src/java/org/apache/james/nntpserver/repository NNTPGroupImpl.java
hbedi 01/11/17 17:12:22
Modified: src/java/org/apache/james/nntpserver/repository
NNTPGroupImpl.java
Log:
Fixed bug in GROUP command. The number of messages were not correct. It was at least off by 1.
Revision Changes Path
1.3 +4 -1 jakarta-james/src/java/org/apache/james/nntpserver/repository/NNTPGroupImpl.java
Index: NNTPGroupImpl.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/nntpserver/repository/NNTPGroupImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NNTPGroupImpl.java 2001/11/10 23:10:59 1.2
+++ NNTPGroupImpl.java 2001/11/18 01:12:22 1.3
@@ -28,6 +28,7 @@
private int currentArticle = -1;
private int lastArticle;
private int firstArticle;
+ private int numOfArticles;
// an instance may collect range info once. This involves disk I/O
private boolean articleRangeInfoCollected = false;
NNTPGroupImpl(File root) {
@@ -56,12 +57,14 @@
if ( num > last )
last = num;
}
+ numOfArticles = list.length;
firstArticle = Math.max(first,0);
lastArticle = Math.max(last,0);
articleRangeInfoCollected = true;
}
public int getNumberOfArticles() {
- return getLastArticleNumber() - getFirstArticleNumber();
+ collectArticleRangeInfo();
+ return numOfArticles;
}
public int getFirstArticleNumber() {
collectArticleRangeInfo();
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>