james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Resolved] (MIME4J-200) Uninitialized Static Parser Fields Causes Class Cast & Null Pointer Exceptions
Date Mon, 11 Jul 2011 08:36:00 GMT

     [ 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

        

Mime
View raw message