cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject [C2] Checking vars before assignment
Date Wed, 11 Apr 2001 13:33:49 GMT
Hi,

I noticed a few things when playing a bit. In quite a few places there is
the pattern

public void blahize( Blah blah ) {

  if( this.blah != null ) {
    this.blah = blah;
  }
}

Where blah is context/configuration/componentmanager/other. I am curious -
is this needed. It seems to me that if the method is called twice (which
this method protects against) it is a fault of container and the component
should not be defending against that. Where did this pattern arise and is
it still needed ?

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message