Another option would be: (1) change internal usage to long (2) *add* getter/setter using long to CacheConfig (don't replace the int versions)
This preserves existing functionality but allows for the > 2GB use case. Jon ________________________________________ From: Bill Speirs [[email protected]] Sent: Sunday, August 14, 2011 9:44 PM To: HttpComponents Project Subject: Re: [jira] [Commented] (HTTPCLIENT-1116) ResponseCachingPolicy uses integers for sizes Why wouldn't you throw an exception? Regardless, people are going to have to change their code when dealing with sizes > MAX. With the exception you know exactly what the issue is. With returning MAX, it could take the user much longer to track down the issue. My $0.02... Bill- On Aug 14, 2011 5:30 PM, "Oleg Kalnichevski (JIRA)" <[email protected]> wrote: > > [ https://issues.apache.org/jira/browse/HTTPCLIENT-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084907#comment-13084907] > > Oleg Kalnichevski commented on HTTPCLIENT-1116: > ----------------------------------------------- > > As far as I can tell the second option should be good enough. > > Oleg > >> ResponseCachingPolicy uses integers for sizes >> --------------------------------------------- >> >> Key: HTTPCLIENT-1116 >> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1116 >> Project: HttpComponents HttpClient >> Issue Type: Bug >> Components: Cache >> Affects Versions: 4.1.1, 4.2 Alpha1 >> Reporter: Greg Bowyer >> Labels: cache, policy >> Attachments: 0001-Changed-the-ResponseCachingPolicy-to-use-longs.patch >> >> >> ResponseCachingPolicy currently uses integers for interpreting the size of Content-Length, as well internally. >> This causes issues in attempting to use the module for caching entities that are over 2GB in size, the module does not fail gracefully, but throws a NumberFormatException >> I have a patch that fixes this, by promoting the int -> long, which should allow for larger entities to be cached, it also updates the public facing API where possible, I don't think that the promotion should break compatibility massively >> The changes can also be seen here: >> https://github.com/GregBowyer/httpclient/commit/1197d3f94bd2eedcec32646cd6146748ca2e6fa1 > > -- > This message is automatically generated by JIRA. > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
