You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Mark Ford (JIRA)" <ji...@apache.org> on 2009/03/31 18:21:34 UTC

[jira] Created: (SM-1835) whitespace interfering with ResolvedEndpoint.resolveEndpoint()

whitespace interfering with ResolvedEndpoint.resolveEndpoint()
--------------------------------------------------------------

                 Key: SM-1835
                 URL: https://issues.apache.org/activemq/browse/SM-1835
             Project: ServiceMix
          Issue Type: Bug
          Components: servicemix-common
    Affects Versions: 3.3
            Reporter: Mark Ford
            Priority: Minor


The code snippet below is from org.apache.servicemix.common.ResolvedEndpoint :

    public static ServiceEndpoint resolveEndpoint(DocumentFragment epr, QName elementName, QName serviceName, String uriPrefix) {
        if (epr.getChildNodes().getLength() == 1) {
            Node child = epr.getFirstChild();

The check for the number of child nodes should be checking for the number of element children as opposed to any child like a text node. The way it is now will reject an endpoint reference that has whitespace preceding it. 

For example:

DocumentFragment:
\n
<wsa:EndpointReference ...>
\t<wsa:Address>...</wsa:Address>
</wsa:EndpointReference>

The work around is to ensure that whitespace is stripped from the EPR prior to it entering SMX. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (SM-1835) whitespace interfering with ResolvedEndpoint.resolveEndpoint()

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on SM-1835 started by Freeman Fang.

> whitespace interfering with ResolvedEndpoint.resolveEndpoint()
> --------------------------------------------------------------
>
>                 Key: SM-1835
>                 URL: https://issues.apache.org/activemq/browse/SM-1835
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-common
>    Affects Versions: 3.3
>            Reporter: Mark Ford
>            Assignee: Freeman Fang
>            Priority: Minor
>         Attachments: patchfile.txt, test-patch.txt
>
>
> The code snippet below is from org.apache.servicemix.common.ResolvedEndpoint :
>     public static ServiceEndpoint resolveEndpoint(DocumentFragment epr, QName elementName, QName serviceName, String uriPrefix) {
>         if (epr.getChildNodes().getLength() == 1) {
>             Node child = epr.getFirstChild();
> The check for the number of child nodes should be checking for the number of element children as opposed to any child like a text node. The way it is now will reject an endpoint reference that has whitespace preceding it. 
> For example:
> DocumentFragment:
> \n
> <wsa:EndpointReference ...>
> \t<wsa:Address>...</wsa:Address>
> </wsa:EndpointReference>
> The work around is to ensure that whitespace is stripped from the EPR prior to it entering SMX. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (SM-1835) whitespace interfering with ResolvedEndpoint.resolveEndpoint()

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned SM-1835:
--------------------------------

    Assignee: Freeman Fang

> whitespace interfering with ResolvedEndpoint.resolveEndpoint()
> --------------------------------------------------------------
>
>                 Key: SM-1835
>                 URL: https://issues.apache.org/activemq/browse/SM-1835
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-common
>    Affects Versions: 3.3
>            Reporter: Mark Ford
>            Assignee: Freeman Fang
>            Priority: Minor
>         Attachments: patchfile.txt, test-patch.txt
>
>
> The code snippet below is from org.apache.servicemix.common.ResolvedEndpoint :
>     public static ServiceEndpoint resolveEndpoint(DocumentFragment epr, QName elementName, QName serviceName, String uriPrefix) {
>         if (epr.getChildNodes().getLength() == 1) {
>             Node child = epr.getFirstChild();
> The check for the number of child nodes should be checking for the number of element children as opposed to any child like a text node. The way it is now will reject an endpoint reference that has whitespace preceding it. 
> For example:
> DocumentFragment:
> \n
> <wsa:EndpointReference ...>
> \t<wsa:Address>...</wsa:Address>
> </wsa:EndpointReference>
> The work around is to ensure that whitespace is stripped from the EPR prior to it entering SMX. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-1835) whitespace interfering with ResolvedEndpoint.resolveEndpoint()

Posted by "Mark Ford (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Ford updated SM-1835:
--------------------------

    Attachment: test-patch.txt
                patchfile.txt

Patch and test for ResolvedEndpoint.resolveEndpoint(). Elements are the only nodes that are considered when traversing the DocumentFragment.

> whitespace interfering with ResolvedEndpoint.resolveEndpoint()
> --------------------------------------------------------------
>
>                 Key: SM-1835
>                 URL: https://issues.apache.org/activemq/browse/SM-1835
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-common
>    Affects Versions: 3.3
>            Reporter: Mark Ford
>            Priority: Minor
>         Attachments: patchfile.txt, test-patch.txt
>
>
> The code snippet below is from org.apache.servicemix.common.ResolvedEndpoint :
>     public static ServiceEndpoint resolveEndpoint(DocumentFragment epr, QName elementName, QName serviceName, String uriPrefix) {
>         if (epr.getChildNodes().getLength() == 1) {
>             Node child = epr.getFirstChild();
> The check for the number of child nodes should be checking for the number of element children as opposed to any child like a text node. The way it is now will reject an endpoint reference that has whitespace preceding it. 
> For example:
> DocumentFragment:
> \n
> <wsa:EndpointReference ...>
> \t<wsa:Address>...</wsa:Address>
> </wsa:EndpointReference>
> The work around is to ensure that whitespace is stripped from the EPR prior to it entering SMX. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SM-1835) whitespace interfering with ResolvedEndpoint.resolveEndpoint()

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50931#action_50931 ] 

Guillaume Nodet commented on SM-1835:
-------------------------------------

Do you think you could provide a patch for that along with a unit test maybe ?

> whitespace interfering with ResolvedEndpoint.resolveEndpoint()
> --------------------------------------------------------------
>
>                 Key: SM-1835
>                 URL: https://issues.apache.org/activemq/browse/SM-1835
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-common
>    Affects Versions: 3.3
>            Reporter: Mark Ford
>            Priority: Minor
>
> The code snippet below is from org.apache.servicemix.common.ResolvedEndpoint :
>     public static ServiceEndpoint resolveEndpoint(DocumentFragment epr, QName elementName, QName serviceName, String uriPrefix) {
>         if (epr.getChildNodes().getLength() == 1) {
>             Node child = epr.getFirstChild();
> The check for the number of child nodes should be checking for the number of element children as opposed to any child like a text node. The way it is now will reject an endpoint reference that has whitespace preceding it. 
> For example:
> DocumentFragment:
> \n
> <wsa:EndpointReference ...>
> \t<wsa:Address>...</wsa:Address>
> </wsa:EndpointReference>
> The work around is to ensure that whitespace is stripped from the EPR prior to it entering SMX. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SM-1835) whitespace interfering with ResolvedEndpoint.resolveEndpoint()

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved SM-1835.
------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2.4
                   3.3.1

apply patch on behalf of Mark with thanks
http://svn.apache.org/viewvc?rev=764353&view=rev for 3.2 branch
http://svn.apache.org/viewvc?rev=764354&view=rev for shared-libraries project

> whitespace interfering with ResolvedEndpoint.resolveEndpoint()
> --------------------------------------------------------------
>
>                 Key: SM-1835
>                 URL: https://issues.apache.org/activemq/browse/SM-1835
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-common
>    Affects Versions: 3.3
>            Reporter: Mark Ford
>            Assignee: Freeman Fang
>            Priority: Minor
>             Fix For: 3.3.1, 3.2.4
>
>         Attachments: patchfile.txt, test-patch.txt
>
>
> The code snippet below is from org.apache.servicemix.common.ResolvedEndpoint :
>     public static ServiceEndpoint resolveEndpoint(DocumentFragment epr, QName elementName, QName serviceName, String uriPrefix) {
>         if (epr.getChildNodes().getLength() == 1) {
>             Node child = epr.getFirstChild();
> The check for the number of child nodes should be checking for the number of element children as opposed to any child like a text node. The way it is now will reject an endpoint reference that has whitespace preceding it. 
> For example:
> DocumentFragment:
> \n
> <wsa:EndpointReference ...>
> \t<wsa:Address>...</wsa:Address>
> </wsa:EndpointReference>
> The work around is to ensure that whitespace is stripped from the EPR prior to it entering SMX. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.