Description
The Broker's string resolution system org.apache.qpid.server.util.Strings#expand()} uses an OwnAttributeResolver to allow an object's attributes to be interpolated into string values. This is provided by the this:<attribute name> syntax.
I have noticed that the value yielded by the expansion this:<attribute name> within a context variable varies depending on where the context variable is defined.
Imagine a context variable foo set with the value "${this:bar}".
- If the context variable comes from the environment or from a managed context default, the this: resolves at the target object. (i.e. targetObject.getContextValue(String.class, "foo") yields a value equivalent to targetObject.getAttribute("bar")).
- If the context variable is set on a ancestor object, the resolution takes place at the ancestor ie. (i.e. targetObject.getContextValue(String.class, "foo") yields a value equivalent to targetObject.getParent()...getAttribute("bar"})
This behaviour surprises me. I don't think it leads to a current functional issue. I think all our existing usages of this: are within managed context defaults (fall into category 1).