You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-dev@incubator.apache.org by Niklas Gustavsson <ni...@protocol7.com> on 2006/01/14 18:34:00 UTC

Coding conventions: use of local variables

Hi

within the code we have quite a few of these constructions:

FtpRequestImpl request = m_request;
if(request != null) {
     request.setObserver(observer);
}

I'm trying to understand the rationale behind these. Is it a coding 
convention that we for any reason would like to keep?

/niklas

-------
Niklas Gustavsson
http://www.protocol7.com
mailto:niklas@protocol7.com


Re: Coding conventions: use of local variables

Posted by Niklas Gustavsson <ni...@protocol7.com>.
Makes sense, thanks!

/niklas

Sergey Vladimirov wrote:
> Hi, Niklas,
> 
> It is protection from NPE due to multithreading
> 
> 2006/1/14, Niklas Gustavsson <ni...@protocol7.com>:
> 
>> Hi
>>
>> within the code we have quite a few of these constructions:
>>
>> FtpRequestImpl request = m_request;
>> if(request != null) {
>>     request.setObserver(observer);
>> }
>>
>> I'm trying to understand the rationale behind these. Is it a coding
>> convention that we for any reason would like to keep?
>>
>> /niklas
>>
>> -------
>> Niklas Gustavsson
>> http://www.protocol7.com
>> mailto:niklas@protocol7.com
>>
>>
> 
> 
> --
> Sergey Vladimirov
> 


-- 
-------
Niklas Gustavsson
http://www.protocol7.com
mailto:niklas@protocol7.com


Re: Coding conventions: use of local variables

Posted by Sergey Vladimirov <vl...@gmail.com>.
Hi, Niklas,

It is protection from NPE due to multithreading

2006/1/14, Niklas Gustavsson <ni...@protocol7.com>:

> Hi
>
> within the code we have quite a few of these constructions:
>
> FtpRequestImpl request = m_request;
> if(request != null) {
>     request.setObserver(observer);
> }
>
> I'm trying to understand the rationale behind these. Is it a coding
> convention that we for any reason would like to keep?
>
> /niklas
>
> -------
> Niklas Gustavsson
> http://www.protocol7.com
> mailto:niklas@protocol7.com
>
>


--
Sergey Vladimirov