You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Dan Lester <da...@danlester.com> on 2008/03/14 14:55:22 UTC

Small patch for cache bug in latest version of GadgetSpecFetcher

I just noticed a problem where the latest GadgetSpecFetcher does not
seem to load from cache. That's because it doesn't, due to a slight
oversight:

It was calling cache.get(url) without storing the return value anywhere,
before checking (spec==null). The attatched one-liner patch just
replaces it with spec = cache.get(url).

Probably easier just to edit it manually, but I attached the patch for
completeness.

Thanks,

Dan

Re: Small patch for cache bug in latest version of GadgetSpecFetcher

Posted by Kevin Brown <et...@google.com>.
Thanks, I'll go ahead and apply this. I thought I had a test case covering
this but I guess I didn't.

On Fri, Mar 14, 2008 at 7:03 AM, Dan Lester <da...@danlester.com> wrote:

> OK, attachment was removed:
>
>
> Index: GadgetSpecFetcher.java
> ===================================================================
> --- GadgetSpecFetcher.java      (revision 637100)
> +++ GadgetSpecFetcher.java      (working copy)
> @@ -52,7 +52,7 @@
>   public GadgetSpec fetch(URI url, boolean forceReload) throws
> GadgetException {
>     GadgetSpec spec = null;
>     if (!forceReload) {
> -      cache.get(url);
> +      spec = cache.get(url);
>     }
>     if (spec == null) {
>       RemoteContentRequest request = new RemoteContentRequest(url);
>
>
> I said it was tiny!
>
> -----Original Message-----
> From: Dan Lester [mailto:dan@danlester.com]
> Sent: 14 March 2008 13:55
> To: shindig-dev@incubator.apache.org
> Subject: Small patch for cache bug in latest version of
> GadgetSpecFetcher
>
>
>
> I just noticed a problem where the latest GadgetSpecFetcher does not
> seem to load from cache. That's because it doesn't, due to a slight
> oversight:
>
> It was calling cache.get(url) without storing the return value anywhere,
> before checking (spec==null). The attatched one-liner patch just
> replaces it with spec = cache.get(url).
>
> Probably easier just to edit it manually, but I attached the patch for
> completeness.
>
> Thanks,
>
> Dan
>
>


-- 
~Kevin

RE: Small patch for cache bug in latest version of GadgetSpecFetcher

Posted by Dan Lester <da...@danlester.com>.
OK, attachment was removed:


Index: GadgetSpecFetcher.java
===================================================================
--- GadgetSpecFetcher.java	(revision 637100)
+++ GadgetSpecFetcher.java	(working copy)
@@ -52,7 +52,7 @@
   public GadgetSpec fetch(URI url, boolean forceReload) throws
GadgetException {
     GadgetSpec spec = null;
     if (!forceReload) {
-      cache.get(url);
+      spec = cache.get(url);
     }
     if (spec == null) {
       RemoteContentRequest request = new RemoteContentRequest(url);


I said it was tiny!

-----Original Message-----
From: Dan Lester [mailto:dan@danlester.com] 
Sent: 14 March 2008 13:55
To: shindig-dev@incubator.apache.org
Subject: Small patch for cache bug in latest version of
GadgetSpecFetcher



I just noticed a problem where the latest GadgetSpecFetcher does not
seem to load from cache. That's because it doesn't, due to a slight
oversight:

It was calling cache.get(url) without storing the return value anywhere,
before checking (spec==null). The attatched one-liner patch just
replaces it with spec = cache.get(url).

Probably easier just to edit it manually, but I attached the patch for
completeness.

Thanks,

Dan