Even a single underscore or double underscore prefix seems
reasonable... I've never seen anyone use an underscore prefix for
method args, the convention (when used) seems to be mostly for local
args.

If you want to be extra careful, you could always add APT warnings if
someone uses a pattern that potentially conflicts (like a method arg
named '__bc_foo" in your original proposal).    This seems like
reasonable protection for the edge cases.

The other option would be to leave the local variables as is, and
prefix their usage with "this.", which will prevent accidental
override by a (same-named) method arg.  This is only one character
more than '__bc_"   ;)

Cheers!

-- Kyle

On 2/15/06, Eddie O'Neil <[EMAIL PROTECTED]> wrote:
> Chad--
>
>   Seems like the right change to make.  If we're going to do it for
> one file, it should probably be done for all of the generated sources
> to make it clear what was code gen'ed (and what the framework
> implicitly owns).
>
>   So, I'd say add "__bc_" as a prefix to all of the local variables
> declared in generated Controls files.
>
>   My $0.02...
>
> Eddie
>
>
> On 2/13/06, Chad Schoettger <[EMAIL PROTECTED]> wrote:
> > To resolve the bug BEEHIVE-1066 I was thinking of prefixing the offending
> > local variables in the ControlBean.vm  velocity template as follows:
> >
> > __bc_<var_name>
> >
> > Does anyone on the list have any thoughts about making this the standard
> > naming pattern for local variables in the control's velocity templates?  It
> > would make the generated code more difficult to read but should eliminate
> > the possibility of some variant of this bug occurring in the future.
> >
> > - Chad
> >
> >
>

Reply via email to