bayeux4netty patch

Dai Jun guiwuu at gmail.com
Tue Sep 1 09:44:36 EDT 2009


Hi Bob,

On Tue, Sep 1, 2009 at 8:25 PM, Bob McWhirter<bmcwhirt at redhat.com> wrote:
>
>>> These characters, '.', 'e', 'E', in number are not non-revevant
>>> characters. They declare it is a real, which will be parse into Long
>>> here. Do you mean when they comes for second time, they will be
>>> treated as non-revevant characters? Currently in such case,  the
>>> string is still parsed to number and throw a Exception in method
>>> Double.parseDouble(). Am I missing something? Or could you provide a
>>> test case to reproduce your problem?
>>
>> I guess I've found the problem you mentioned. I add a new UT
>> BayexuMessageFactoryTest to test that. It shrows a
>> illegelStatementException, which should not happend. It's
>> JSONParser.parserToNumber that swallow the last char, which shoud be
>> returned after parsering. Then I add method json.back right above
>> return statement and fix it.
>
> Yah, it's not so much the non-number characters like ./e/E, but rather any
> trailing characters, such as in
>
>        [{id: 2}]
>
> The curly would be consumed by parseToNumber(), and parseToObject() would
> freak out seeing a ] instead of the } it was expecting.

Yes, thanks for your suggestion. I've already fix that. But the
solution is somewhat different from yours. If it doesn't work well,
please let me know.

>
>>> Thanks very much. I've merge it into trunk of bayeux4netty and add a
>>> null checking.
>
> Cool, thanks!
>
> As I keep working my way through, would you like me to continue to send
> patches?  Or would you like me to just commit any small changes?  (I'd
> discuss any large-scale changes on the list before going ahead with them, of
> course).

Yes, I'd love to receive patches from you and discuss anything about
it. Do you have the SVN permission? If so, you could commit by
yourself surely.

BTW, we could discuss Bayeux in Netty's maillist and let community
know. More peole can get involved in our work.

>
>        Thanks,
>
>        -Bob
>

Best regards,

Dai Jun or Danny Dai(in English) - http://guiwuu.googlepages.com
GTalk: guiwuu at gmail.com | QQ: 93409048 | MSN: guiwuu at hotmail.com |
Twitter: @guiwuu

Jonathan Swift  - "May you live every day of your life." -
http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html



More information about the netty-dev mailing list