On Thu, Feb 01, 2001 at 10:22:03AM -0800, Jon Stevens wrote:
> From: John McNally <[EMAIL PROTECTED]>
> I think any static initialization will finish before class methods are
> executed so the following should be thread safe (ignore the cvs
> characters, please)
> 
> >   +    static private Vector fieldNames_ = initFieldNames;

s/initFieldNames/initFieldNames()/

otherwise that would do it too, and avoid the overhead of synchronizing
getFieldNames - but add the overhead of allocation of the Vector for
each BO class loaded even if getFieldNames is never called. I'm easy
either way to be honest...

> 
> >   +    static public Vector getFieldNames()
> >   +    {
> >   +      return fieldNames_;
> >   +    }
> >   +
>  private static Vector initFieldNames()
>  {
> >   +        Vector fieldNames = new Vector();
> >   +    #foreach ($col in $table.Columns)
> >   +        fieldNames_.add("${col.JavaName}");
> >   +    #end
>       return fieldNames;
>  }
> 
-- 
Sean Legassick
[EMAIL PROTECTED]
      Soy un hombre: nada humano me es extrano  
      
      


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to