DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=32152>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32152 Problem calculating total article count Summary: Problem calculating total article count Product: Commons Version: 1.2 Final Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Net AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I am using Commons Net 1.2.2 When you ask for the list of newsgroups of a NNTP Server, the framework doesn't calculate correctly the total article count when that specific newsgroup has no articles. For example, the NNTP Server answers something like this: org.javahispano.j2ee 0 0 y then, debugging the source code of class: org.apache.commons.net.nntp.NNTPClient I found the problem in method: private NewsgroupInfo __parseNewsgroupListEntry(String entry) where it does: ... result._setNewsgroup(tokenizer.nextToken()); last = tokenizer.nextToken(); first = tokenizer.nextToken(); permission = tokenizer.nextToken(); try { lastNum = Integer.parseInt(last); firstNum = Integer.parseInt(first); result._setFirstArticle(firstNum); result._setLastArticle(lastNum); result._setArticleCount(lastNum - firstNum + 1); } catch (NumberFormatException e) { return null; } The proble is in this line: result._setArticleCount(lastNum - firstNum + 1); where if lastNum is 0 and firstNum is 0, it sais that the newsgroup has 1 article. I understand the code should add a control line where it double check if lastNum and firstNum are 0. Right? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
