commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rory Winston (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (NET-155) Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry() function)
Date Thu, 29 Mar 2007 15:37:25 GMT

     [ https://issues.apache.org/jira/browse/NET-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rory Winston resolved NET-155.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

Fix applied.

> Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry()
function)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: NET-155
>                 URL: https://issues.apache.org/jira/browse/NET-155
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: any
>            Reporter: Krzysztof Jakubczyk
>             Fix For: 2.0
>
>
> running the following code:
>   client.connect("news.icm.edu.pl");
>   NewsgroupInfo[] grps = client.listNewsgroups();
> results MalformedServerReplyException (alt.atheism 2147485259 2147483647 y)
> it's because in function NNTPClient.__parseNewsgroupListEntry():
> last = tokenizer.nextToken();
>         first = tokenizer.nextToken();
>         permission = tokenizer.nextToken();
>         try
>         {
>             lastNum = Integer.parseInt(last);
>             firstNum = Integer.parseInt(first);
>             result._setFirstArticle(firstNum);
>             result._setLastArticle(lastNum);
> 	    if((firstNum == 0) && (lastNum == 0))
> 		    result._setArticleCount(0);
> 	    else
> 		    result._setArticleCount(lastNum - firstNum + 1);
>         }
>         catch (NumberFormatException e)
>         {
>             return null;
>         }
> lastNum and firstNum are Integer (too small for received values)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message