Return-Path: Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: (qmail 42991 invoked from network); 31 Mar 2011 08:26:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2011 08:26:11 -0000 Received: (qmail 79391 invoked by uid 500); 31 Mar 2011 08:26:06 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 79092 invoked by uid 500); 31 Mar 2011 08:25:57 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 79031 invoked by uid 99); 31 Mar 2011 08:25:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2011 08:25:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2011 08:25:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 87C0E8BDE7 for ; Thu, 31 Mar 2011 08:25:06 +0000 (UTC) Date: Thu, 31 Mar 2011 08:25:06 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: mime4j-dev@james.apache.org Message-ID: <1726640016.23756.1301559906552.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (MIME4J-145) Improve organization of fields and fields parsers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MIME4J-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski reassigned MIME4J-145: ---------------------------------------- Assignee: Oleg Kalnichevski (was: Stefano Bagnara) > Improve organization of fields and fields parsers > ------------------------------------------------- > > Key: MIME4J-145 > URL: https://issues.apache.org/jira/browse/MIME4J-145 > Project: JAMES Mime4j > Issue Type: Improvement > Affects Versions: 0.6 > Reporter: Stefano Bagnara > Assignee: Oleg Kalnichevski > Priority: Minor > Fix For: 0.7 > > > I'd like to fix some issue in the organization of fields and field parsers asap, while we are still on "low" (0.x) release numbers. > One thing is to remove DefaultFieldParser knowledge in AbstractField, another would be to reorganize things so that parsing of headers is done in a single place. Currently we have some parsing in Fields, some parsing in MaximalBodyDescriptor, some parser use the DefaultFieldParser, some other code instead directly instantiate the AbstractField instance. > One more thing is parsing of raw headers: we have 2 different logic to do the same thing. Once in RawBody where we do one thing to extract name and body, and once in DefaultFieldParser.parse(final ByteSequence raw), where we do different things. E.g: the first simply locate the ":" and do not remove any starting space from the body, the second instead has a regexp matching valid header names and remove the starting space from the body. > Last one is MimeUtil.getHeaderParams, a parser that will parse header parameters. It is used by MaximalBodyDescriptor.parseContentDisposition and by DefaultBodyDescriptor.parseContentType. At the same type we have ContentTypeParser and ContentDispositionParser classes also doing parsing for that headers. Why do we have 2 implementations for the parsing of the same headers? > Is there a logic behind this or is this simply the result of years of different hands and refactorings and we simply should fix it? -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira