I believe that the code mentioned should not be generated by default.

If the context, in this case whether the intended use is single or multi-threaded, 
cannot be determined by Idea automatically then the user should be asked to supply it. 
 This could be by way of checkbox, by way of different accessor key combinations etc.  
If that is not feasible or clumsy then the functionality should not be there.

Context should not be assumed.  There are many situations where such assumptions can 
lead to bad things.  Novice programmers are not the only ones to fall foul to an 
application thinking it knows best -- it can happen to all of us during a moment of 
"lesser concentration".

Anyhow, that's just my thoughts on the matter.  The Idea guys will obviously make 
their own decisions, it is their IDE after all :)

Paul.



                                                                                       
                                                                                       
   
                      Nathan Brown                                                     
                                                                                       
   
                      <[EMAIL PROTECTED]>                 To:       
[EMAIL PROTECTED]                                                       
                       
                      Sent by:                           cc:                           
                                                                                       
   
                      [EMAIL PROTECTED]        Subject:  [Eap-features] Re: 
Add lazy initialization to the "Encapsulate fields" refactoring                        
    
                      tbrains.com                                                      
                                                                                       
   
                                                                                       
                                                                                       
   
                                                                                       
                                                                                       
   
                      01/07/2002 10:14                                                 
                                                                                       
   
                      Please respond to                                                
                                                                                       
   
                      eap-features                                                     
                                                                                       
   
                                                                                       
                                                                                       
   
                                                                                       
                                                                                       
   




Just because generated code is not thread safe, that doesn't mean it
shouldn't be generated.  If a person doesn't know enough to synchronize
the correct parts of their code then they shouldn't be programming java
at all; the ide should not be shielding design complexity from them or
allowing them not to have to think about it.

Paul Ruane wrote:
> This should not happen by default as it's not thread-safe.
>
>
>
>
>                       Nathan Brown
>                       <[EMAIL PROTECTED]>                 To:       
>[EMAIL PROTECTED]
>                       Sent by:                           cc:
>                       [EMAIL PROTECTED]        Subject:  [Eap-features] 
>Add lazy initialization to the "Encapsulate fields" refactoring
>                       tbrains.com
>
>
>                       25/06/2002 18:41
>                       Please respond to
>                       eap-features
>
>
>
>
>
>
> It would be great if the "Encapsulate fields" refactoring could also
> support lazy initialization when an initialization statement exists at
> the field declaration and the field is of an object type.
>
> Using this option, the existing initialization would be moved into the
> get method so that :
>
> private Object _value = new ExpensiveObject();
>
> would be transformed to
>
> private Object _value;
>
> public Object getValue()
> {
>    if (_value == null) {
>      _value = new ExpensiveObject();
>    }
>    return value;
> }
>
> N.
>
> _______________________________________________
> Eap-features mailing list
> [EMAIL PROTECTED]
> http://lists.jetbrains.com/mailman/listinfo/eap-features
>
>
>
>
> --
>
> This e-mail may contain confidential and/or privileged information. If you are not 
>the intended recipient (or have received this e-mail in error) please notify the 
>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
>distribution of the material in this e-mail is strictly forbidden.
>
>

_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features




--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to