You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2017/10/02 07:50:00 UTC

[jira] [Updated] (QPID-7943) [Java Broker] The result of the interpolation this: differs

     [ https://issues.apache.org/jira/browse/QPID-7943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Keith Wall updated QPID-7943:
-----------------------------
    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).


  was:

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).



> [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: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org