This thread goes sooooo loooooooooong with all of you
showing yours that I can't resist showing mine:
public void setSomething(Object i_something)
{
m_something = i_something;
}
Or even...
public void setSomething(Object i_something)
{
Object something; // a local something
something = fixThat(i_something);
if (isCool(something))
{
m_something = i_something;
}
else
{
throw new IllegalArgumentException("What a bad thing we have
here!!!");
}
}
Prefix paranoia huh?
But I never mix class members with parameters or with local
vars due to similar spellings and misspellings and so.
Have fun,
Paulo Gaspar
> -----Original Message-----
> From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 10, 2002 11:26 PM
> To: Jakarta General List
> Subject: Re: More abuse of coding styles...
>
>
> Sam Ruby wrote:
>
> > Stephane Bailliez wrote:
> >
> >>I can understand why:
> >>
> >>public void setSomething(Object something){
> >> something = something;
> >>}
> >>
> >
> > Another solution is
> >
> > public void setSomething(Object something) {
> > this.something = something;
> > }
>
>
> Just beware of this bug:
>
> public void setSomething(Object somthing) { // something misspelled
> this.something = something;
> }
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>