hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Moore (Reopened) (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (HTTPCLIENT-1152) org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage should verify class of returned object before casting
Date Wed, 21 Dec 2011 18:55:31 GMT

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

Jon Moore reopened HTTPCLIENT-1152:
-----------------------------------


I'm actually going to reopen this, as I think it's a pretty small change that adds to the
robustness of the library (and I'll work on integrating and committing it). Upon encountering
something weird coming back out of memcached, I think logging a warning and then acting as
if it were a cache miss is good and prudent behavior.

                
> org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage should verify class
of returned object before casting
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1152
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1152
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache, HttpClient
>    Affects Versions: 4.1.1
>            Reporter: Clinton Nielsen
>            Assignee: Jon Moore
>         Attachments: HTTPCLIENT-1152.patch
>
>
> org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
> Original (in getEntry function): 
>   byte[] data = (byte[]) client.get(url);
> Should be:
>   Object obj= client.get(url);
>   if (null == obj || !(objinstanceof byte[])) {
>     return null;
>   }
>   byte[] data = (byte[])obj;
> Original (in updateEntry function):
>   byte[] oldBytes = (v != null) ? (byte[]) v.getValue() : null;
> Should be:
>   byte[] oldBytes = (v != null && (v.getValue() instanceof byte[])) ? (byte[])
v.getValue() : null;
>   

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message