Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-147

Move "default parsing" logic from AbstractField to DefaultFieldParser

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.6
    • 0.7
    • None
    • None

    Description

      As suggested in the ml we should move the default "delegation based" parsing logic from AbstractField to DefaultFieldParser.
      This way we remove a lot of cycles in the code and the "default parsing" is exposed vua DefaultFieldParser instead of AbstractField (i never liked exposing a public feature via a static method of an abstract class).

      here the ml message:

      AbstractField is the abstract class extended by each specific field
      implementation.

      AbstractField, at the same time, provide "static" access to a
      DefaultFieldParser and provides static methods to get a
      DefaultFieldParser and to parse a string into a field using that
      default field parser.

      So every field extend abstractField but AbstractField have a link to
      every of its implementations via DefaultFieldParser =>
      DelegatingFieldParser.

      This smells like a very bad idea. Is it me?

      So, if you agree this should be improved here are 2 alternative solutions:
      1) the easy fix would be to move all of the static stuff from
      AbstractField to DefaultFieldParser. As the methods are public static
      methods this would introduce a backward compatibility issue.

      Attachments

        Activity

          People

            bago Stefano Bagnara
            bago Stefano Bagnara
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: