camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: org.apache.camel.util.URISupport
Date Fri, 23 May 2014 06:54:04 GMT
On Fri, May 23, 2014 at 8:48 AM, Charles Moulliard <ch007m@gmail.com> wrote:
> I will delete my ticket. Have you committed the modification otherwise I
> have done it ...
>

Yes I got a fix that is currently being tested. So let me handle this.

>
> On Fri, May 23, 2014 at 8:46 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>
>> Hi
>>
>> There is already a ticket
>> https://issues.apache.org/jira/browse/CAMEL-7459
>>
>> On Fri, May 23, 2014 at 8:41 AM, Charles Moulliard <ch007m@gmail.com>
>> wrote:
>> > Thx for the info. I will open a ticket and add the correction
>> >
>> >
>> > On Thu, May 22, 2014 at 9:19 PM, jwblackw <jamesblackwood@gmail.com>
>> wrote:
>> >
>> >> org.apache.camel.util.URISupport
>> >>
>> >> line 158
>> >>
>> >> if (i < uri.length() - 2) {
>> >>
>> >> This instead should be:
>> >>
>> >> if (i <= uri.length() - 2) {
>> >>
>> >> The reason is that you are trying to calculate the next character.
>> >> So for example if we take the string "abc"
>> >> When i = 0   we are at 'a' and we calculate next as 'b'
>> >> But when i = 1 we are at 'b' and next should be 'c', but since the if
>> >> statement fails the else statement runs and next gets set to '\u0000'
>> >>
>> >> "abc" is a simple example.  Let's try something more "real world" now.
>> >>
>> >> The problem occurs when you have this example string:
>> >>
>> "flatten=false&recursive=false&delete=true&include=RAW(%5E.*%5B.%5D(xml))"
>> >>
>> >> If you try that string, you can see based on the logic when we get to
>> the
>> >> "closed paren" after the l in xml... next gets set to '\u0000' instead
>> of
>> >> ')' like it should.  And then when we get to line 177
>> >> boolean end = ch == RAW_TOKEN_END.charAt(0) && (next == '&'
|| next ==
>> >> '\u0000');
>> >> end gets set to true, when really we are not at the end.  We had 1 more
>> >> "closed paren" to process.
>> >>
>> >> Thus my last value gets set to RAW(%5E.*%5B.%5D(xml)
>> >> When it really should be RAW(%5E.*%5B.%5D(xml))
>> >>
>> >> Thanks for correcting this.
>> >> -James
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://camel.465427.n5.nabble.com/org-apache-camel-util-URISupport-tp5751485.html
>> >> Sent from the Camel Development mailing list archive at Nabble.com.
>> >>
>> >
>> >
>> >
>> > --
>> > Charles Moulliard
>> > Apache Committer / Architect @RedHat
>> > Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message