james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Burrell Donkin" <robertburrelldon...@gmail.com>
Subject Re: Bug in ContentTypeParser.jj?
Date Tue, 18 Mar 2008 19:14:07 GMT
On Mon, Mar 17, 2008 at 11:43 PM, Antony Bowesman <adb@teamware.com> wrote:

> Hi,
>
> The ContentTypeParser does not like boundary strings that only contain
> digits.


IIRC there are some test mails which use boundary string containing only
digits. if you are willing to contribute a unit test or two that
demonstrates the problem, it'd help a lot. please use
https://issues.apache.org/jira/browse/MIME4J


> My .jj is not so hot,


(mine neither but we usually manage to work it out in the end ;-)


> but I debugged the parser and it is returning 20 as the
> token.kind, whereas it seems to want 19 (QUOTEDSTRING) or 21 (ATOKEN).
>
> I guess 20 is 'DIGITS' and the definition of digits is before ATOKEN, so
> it is
> satisfied before ATOKEN.
>
> Should the fix be either
>
> String value() :
> {Token t;}
> {
> (       t=<ATOKEN>
> |       t=<DIGITS>
> |       t=<QUOTEDSTRING>
> )
>        { return t.image; }
> }
>
> or the ATOKEN definition be defined before DIGITS?


hmmm...

fiddling with the tokenisation seems more risky. so the first sounds like
the better solution to me. (hopefully people will jump in if this seems
wrong to them...)

- robert

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message