Keith Wall created QPID-7943:
--------------------------------
Summary: [Java Broker] The result of the interpolation this:
differs
Key: QPID-7943
URL: https://issues.apache.org/jira/browse/QPID-7943
Project: Qpid
Issue Type: Bug
Components: Java Broker
Reporter: Keith Wall
Priority: Minor
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).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]