On Oct 20, 2009, at 2:02 PM, Asiri Rathnayake wrote:

> Hi,
>
>
>
>> ---
>> platform/core/trunk/xwiki-webdav/src/main/java/com/xpn/xwiki/plugin/ 
>> webdav/XWikiDavServlet.java
>>    2009-10-20 11:50:17 UTC (rev 24575)
>> +++
>> platform/core/trunk/xwiki-webdav/src/main/java/com/xpn/xwiki/plugin/ 
>> webdav/XWikiDavServlet.java
>>    2009-10-20 11:51:34 UTC (rev 24576)
>> @@ -74,17 +74,17 @@
>>    /**
>>     * Locator factory. {...@link DavLocatorFactory}
>>     */
>> -    private DavLocatorFactory locatorFactory;
>> +    private transient DavLocatorFactory locatorFactory;
>>
>>    /**
>>     * Resource factory. {...@link DavResourceFactory}
>>     */
>> -    private DavResourceFactory resourceFactory;
>> +    private transient DavResourceFactory resourceFactory;
>>
>>    /**
>>     * Session provider. {...@link DavSessionProvider}
>>     */
>> -    private DavSessionProvider sessionProvider;
>> +    private transient DavSessionProvider sessionProvider;
>>
>
> This might be a bad way to fix the findbugs errors. I just used it  
> to see if
> it works and committed without second thoughts. Any ideas on how to  
> fix the
> "mutable servlet field" error in a better way?

I don't understand why you've used "transient". Can you explain?

The findbugs descriptions are avail here:
http://findbugs.sourceforge.net/bugDescriptions.html

"
MSF: Mutable servlet field (MSF_MUTABLE_SERVLET_FIELD)
A web server generally only creates one instance of servlet or jsp  
class (i.e., treats the class as a Singleton), and will have multiple  
threads invoke methods on that instance to service multiple  
simultaneous requests. Thus, having a mutable instance field generally  
creates race conditions.

"

Thus IMO we just need to show that we don't change these field values  
over the lifetime of the Servlet and thus use the "final" keyword  
(with some javadoc comment explaining why obviously!).

Thanks

-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to