The remaining Findbugs issues complain about non-transient
non-serializable instance fields in the various Servlets of
org.apache.shindig.gadgets.servlet (see below for details).

Making the underlying classes serializable is impossible. On the other
hand, simply marking these fields as transient will result in partially
initialized Servlets upon deserialization (we can't perform Guice
injection for these fields during readObject, because we won't have
access to the Injector).

A possible solution would be to remove the problematic instance fields
from the Servlet definitions. Instead, we'll inject them into a new
GadgetServletContextListener, which extends GuiceServletContextListener.
This new ServletContextListener then makes the injected fields available
to the Servlets as ServletContext attributes.

I'm about to submit a patch for your review (Patch Set 3). If the patch
is approved, I'll provide an additional patch for the affected unit
tests.

Findbugs errors:

Class org.apache.shindig.gadgets.servlet.GadgetRenderingServlet defines
non-transient non-serializable instance field renderer

Class org.apache.shindig.gadgets.servlet.HtmlAccelServlet defines
non-transient non-serializable instance field accelHandler

Class org.apache.shindig.gadgets.servlet.JsServlet defines non-transient
non-serializable instance field registry

Class org.apache.shindig.gadgets.servlet.MakeRequestServlet defines
non-transient non-serializable instance field makeRequestHandler

Class org.apache.shindig.gadgets.servlet.ProxyServlet defines
non-transient non-serializable instance field proxyHandler

Class org.apache.shindig.gadgets.servlet.RpcServlet defines
non-transient non-serializable instance field jsonHandler

Thanks,

Jan

http://codereview.appspot.com/1712045/show

Reply via email to