getNextComponent and peekNextComponent

Joel Crisp writes:
 > Hi
 > It looks to me as if there is some confusion as the behaviour of
 > resources implementing "lookup" on failure - some seem to consume the
 > path with getNextComponent -then if they have been called from a de
 > rived class via super and fail, the derived class no longer has access
 > to the relevent information. StoreContainer seems to be one of the
 > offenders.

Do you mean StoreContainer should call getNextComponent only *after*
making sure lookup(String name) did succeed ?

 > Personally, I believe that changing getNextComponent to
 > peekNextComponent would be more efficent - note that you have to
 > consume the path if there is a resource found.

If I understand correctly the rule would be for ContainerResource
sub-class to consume part of the path only if lookup succeed, and
otherwise, to leave the LookupState as it was (before lookup was

 > Hmmm. Having said that, if a resource further down the line doesn't
 > find it, the path is consumed anyway. Maybe the whole method needs a
 > re-think and/or some better documentation on the intended behaviour.

I would tend to agree with that, and would like to clear it up before
next release.


Received on Wednesday, 12 March 1997 06:45:50 UTC