You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sebb <se...@gmail.com> on 2010/06/26 15:18:32 UTC

Re: svn commit: r958214 - in /tomcat/trunk/webapps/examples/WEB-INF/classes: CookieExample.java RequestHeaderExample.java RequestInfoExample.java RequestParamExample.java SessionExample.java chat/ChatServlet.java

On 26/06/2010, Felix Schumacher <fe...@internetallee.de> wrote:
> Hi Mark,
>
>  Am Samstag, den 26.06.2010, 12:17 +0000 schrieb markt@apache.org:
>
> > Author: markt
>  > Date: Sat Jun 26 12:17:33 2010
>  > New Revision: 958214
>  >
>  > URL: http://svn.apache.org/viewvc?rev=958214&view=rev
>  > Log:
>  > Fix some Eclispe / Findbugs warnings
>  ...
>  > Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java
>
> > URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java?rev=958214&r1=958213&r2=958214&view=diff
>  > ==============================================================================
>  > --- tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java (original)
>  > +++ tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java Sat Jun 26 12:17:33 2010
>  > @@ -35,7 +35,7 @@ public class CookieExample extends HttpS
>  >
>  >      private static final long serialVersionUID = 1L;
>  >
>  > -    ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>  > +    private transient ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>
> shouldn't we init rb in an init method, so that it will be reinitialized
>  after deserialization, like messageSender in ChatServlet? That way we
>  would get rid of the warnings and have a correct servlet.

Or could they be "private static final" instead?

>  Regards,
>
>  Felix
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

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


Re: svn commit: r958214 - in /tomcat/trunk/webapps/examples/WEB-INF/classes: CookieExample.java RequestHeaderExample.java RequestInfoExample.java RequestParamExample.java SessionExample.java chat/ChatServlet.java

Posted by Mark Thomas <ma...@apache.org>.
On 26/06/2010 14:18, sebb wrote:
> On 26/06/2010, Felix Schumacher<fe...@internetallee.de>  wrote:
>> Hi Mark,
>>
>>   Am Samstag, den 26.06.2010, 12:17 +0000 schrieb markt@apache.org:
>>
>>> Author: markt
>>   >  Date: Sat Jun 26 12:17:33 2010
>>   >  New Revision: 958214
>>   >
>>   >  URL: http://svn.apache.org/viewvc?rev=958214&view=rev
>>   >  Log:
>>   >  Fix some Eclispe / Findbugs warnings
>>   ...
>>   >  Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java
>>
>>> URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java?rev=958214&r1=958213&r2=958214&view=diff
>>   >  ==============================================================================
>>   >  --- tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java (original)
>>   >  +++ tomcat/trunk/webapps/examples/WEB-INF/classes/CookieExample.java Sat Jun 26 12:17:33 2010
>>   >  @@ -35,7 +35,7 @@ public class CookieExample extends HttpS
>>   >
>>   >       private static final long serialVersionUID = 1L;
>>   >
>>   >  -    ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>>   >  +    private transient ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>>
>> shouldn't we init rb in an init method, so that it will be reinitialized
>>   after deserialization, like messageSender in ChatServlet? That way we
>>   would get rid of the warnings and have a correct servlet.
>
> Or could they be "private static final" instead?

That would be less work and probably more correct.

Mark



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