--- On Wed, 7/16/08, Gabriel Belingueres <[EMAIL PROTECTED]> wrote:
> I believe that we could check on stack.push() if the object
> to push shadows some other object in the stack with relative ease.
> 
> The basic idea would be to use a Map<String,Object>
> where the key is the property name, and the value is 
> the object in the stack with that property name. If 
> the yet to push object has a property that is already 
> in the Map, then it would shadow it (unless of course 
> it is actually the same object), and a warn can be
> logged/exception thrown (in devMode only).

You lost me--why would we need to keep a shadow map?

The current code checks if a refresh is needed: if it is, the old object is 
removed via ArrayList.remove(Object), and if appropriate, the new object is 
pushed (the stack order change).

To replace the old object ArrayList.indexOf(Object) would retrieve the index 
and the new object would be set with ArrayList.set(int, Object).

There's still a potential stack depth issue, though, since if the new value is 
null it's not supposed to get put on the stack.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to