Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 207670 - [msn] NotificationSession throws IllegalArgumentException for NLN notifications
Summary: [msn] NotificationSession throws IllegalArgumentException for NLN notifications
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.protocols (show other bugs)
Version: 1.2.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Remy Suen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-27 12:04 EDT by tonys CLA
Modified: 2007-10-27 13:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tonys CLA 2007-10-27 12:04:52 EDT
Build ID:  M20070921-1145
ECF     :  1.20v20071019-1300

Steps To Reproduce:

Doesn't seem to happen in the ECF chat perspective but does reliably occur with a chatbot. The easiest way to repeat it is to split out NotificationSession.read() event parsing code into a seperate method and get the method to parse the following notification:

NLN NLN xxxx.yyyyyyyyyy@hotmail.com Xxxx 512 0


More information:

This specific error occurs because the event parser in NotificationSession.read() picks up NLN at any place in the input string and not just at the beginning of a line. 

However, it looks like the event parser has a more general problem - for example, it will pick up MSN protocol commands encapsulated in a MSG or in fragments of another command or notification. 

e.g. Parsing the following received message: 

MSG Hotmail Hotmail 289
Content-Type:text/x-msmsgsinitialmdatanotification;charset=UTF-8 
                                           Mail-Data:<MD><E><I>0</I><IU>0</IU><O>0</O><OU>0</OU></E><Q><QTM>409600</QTM><QNM>204800</QNM></Q></MD Inbox-URL: /cgi-bin/HoTMaiL                                           Folders-URL: /cgi-bin/folders                                           Post-URL: http://www.hotmail.com
CHG 6 NLN 268435488

throws a StringIndexOutOfBoundsException.
Comment 1 Remy Suen CLA 2007-10-27 13:08:39 EDT
(In reply to comment #0)
> The easiest way to repeat it is to split out
> NotificationSession.read() event parsing code into a seperate method and get
> the method to parse the following notification:
> 
> NLN NLN xxxx.yyyyyyyyyy@hotmail.com Xxxx 512 0

Fixed in CVS HEAD.

> However, it looks like the event parser has a more general problem - for
> example, it will pick up MSN protocol commands encapsulated in a MSG or in
> fragments of another command or notification.

Yes, this is certainly a rather annoying problem. The parsing code / entire implementation will probably need to be rewritten to really handle this properly. Could you file a separate bug for this issue?