From mime4j-dev-return-1596-apmail-james-mime4j-dev-archive=james.apache.org@james.apache.org Mon Jul 11 08:36:45 2011 Return-Path: X-Original-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96C424C7C for ; Mon, 11 Jul 2011 08:36:45 +0000 (UTC) Received: (qmail 9885 invoked by uid 500); 11 Jul 2011 08:36:44 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 9678 invoked by uid 500); 11 Jul 2011 08:36:30 -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 8597 invoked by uid 99); 11 Jul 2011 08:36:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jul 2011 08:36:23 +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; Mon, 11 Jul 2011 08:36:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2E77F45539 for ; Mon, 11 Jul 2011 08:36:00 +0000 (UTC) Date: Mon, 11 Jul 2011 08:36:00 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: mime4j-dev@james.apache.org Message-ID: <413576176.2225.1310373360187.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <564247587.7868.1310051356346.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (MIME4J-200) Uninitialized Static Parser Fields Causes Class Cast & Null Pointer Exceptions 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-200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved MIME4J-200. -------------------------------------- Resolution: Fixed Fix Version/s: 0.7 There have been a lot of changes in the trunk. AbstractField no longer has a dependency on DefaultFieldParser. I believe the issue can be considered fixed. Oleg > Uninitialized Static Parser Fields Causes Class Cast & Null Pointer Exceptions > ------------------------------------------------------------------------------ > > Key: MIME4J-200 > URL: https://issues.apache.org/jira/browse/MIME4J-200 > Project: JAMES Mime4j > Issue Type: Bug > Components: parser (core) > Affects Versions: 0.6.1 > Environment: Linux & Windows in Java > Reporter: Rickard Ekeroth > Fix For: 0.7 > > > The main problem is that e.g. the class ContentTypeField contains a static variable called 'PARSER' which is used by the class DefaultFieldParser. An instance of DefaultFieldParser is created and stored in a static variable in the class AbstractField. The class AbstractField is the base class of the class ContentTypeField. The effect of this is that under certain circumstances (since the static initialization in the base class happens first) the static variable 'PARSER' will be null (not yet initialized) when the class created in the base class reads the value of it. > The above description is valid for all the different field classes that have a static 'PARSER' variable in them. > This does not always manifest itself since it seems that in certain combinations of Java versions and/or operating systems the static variable initialization in the same inheritance hierarchy works differently. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira