[
https://issues.apache.org/jira/browse/MIME4J-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13052501#comment-13052501
]
Stefano Bagnara commented on MIME4J-116:
----------------------------------------
I will try the refactoring with no name changes, first. BodyDescriptorBuilder
may work, but maybe we need some more changes in its behaviour in order to call
it "builder".
I have some confused thoughts about the similarities between BodyDescriptor
(core) and Entity (dom)... and EntityBuilder using the FieldParser, like
MutableBodyDescriptors are going to do... (also something similar happens with
the "Field" interface, RawField, ParsedField). Something sounds *weird* in this
duplication, but I don't have a clear view, yet (maybe an "api" module
including the exceptions and some common interface would make it cleaner, but
I'm going Off Topic and anyway maybe we should concentrate on releasing 0.7
with minor changes and let this kind of thoughts to busy us in 0.8-SNAPSHOT).
> Avoid duplicate parsing of header fields
> ----------------------------------------
>
> Key: MIME4J-116
> URL: https://issues.apache.org/jira/browse/MIME4J-116
> Project: JAMES Mime4j
> Issue Type: Improvement
> Affects Versions: 0.6
> Reporter: Markus Wiederkehr
> Fix For: 0.7
>
>
> Currently some header fields are parsed twice when building a DOM. Once by
> DefaultBodyDescriptor or MaximalBodyDescriptor and a second time by
> MessageBuilder using Field.parse().
> Also different parsers are used in both stages. The body descriptors use
> handcrafted parsers whereas Field.parse uses JavaCC generated parsers. The
> handcrafted version does not seem to handle comments in a header correctly.
> The situation should be improved by parsing a header field only once and
> passing that already parsed field to a content handler. Also only one sort of
> field parser should be used; either handcrafted or generated. My personal
> opinion is that it might be easier for a handcrafted parser to be more
> tolerant against malformed header fields.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira