Noel J. Bergman wrote:
What is your take on the attached?  Rather than throw an Exception
immediately, it consumes until it gets CRLF (or EOF), then throws a unique
Exception.

Notes:
1. If this code receives a loner and then an EOF before a CRLF I believe it will return null, not throw an Exception.
2. I would suggest renaming TerminationError to "something"Exception, since it is a descendant of java.lang.Exception but not of java.lang.Error.
3. In the first of the two lines which say:
case LF : //the normal ending of a line
the comment should say //abnormal character, (or some such).


I do not see an advantage in consuming the misplaced character only to throw an exception about it later. Keeping it makes the code more complex, necessitating the flag (int tainted). I would be inclined to throw the exception immediately upon recognition of the misplaced character.

Shout if you would like me to write that.

Rich


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to