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

Reply via email to