Jochen Wiedmann (JIRA) ha scritto:
>      [ 
> https://issues.apache.org/jira/browse/MIME4J-23?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>  ]
> 
> Jochen Wiedmann updated MIME4J-23:
> ----------------------------------
> 
>     Attachment: mime4j-strict.patch
> 
> It seems to me that introducing a new event listener class just for that 
> seems a little bit much. How about the attached patch: Log mime content 
> errors in a protected method that the user can overwrite?

The patch remove the check for isWarnEnabled: I think a better solution
would be to change the new log method to:

protected void logInvalidMimeContent(String message, Integer lineNumber)
throws MimeException {
   if (log.isWarnEnabled()) {
      log.warn("Line " + lineNumber + ": "+message);
   }
}

(OT: I prefer to use simple string concatenation instead of StringBuffer
because since java 5 for simple cases like the above the compiler will
use StringBuilders and will run even faster than StringBuffers. Even if
at the moment we build with java 1.4 it is much more readable)

The log level change from warn to debug for the encoding notices make
sense to me.

Thank you,
Stefano

>> [JW#3]  Drop lazy syntax checking or make it optional
>> -----------------------------------------------------
>>
>>                 Key: MIME4J-23
>>                 URL: https://issues.apache.org/jira/browse/MIME4J-23
>>             Project: Mime4j
>>          Issue Type: Wish
>>            Reporter: Robert Burrell Donkin
>>         Attachments: mime4j-strict.patch
>>
>>
>> http://mail-archives.apache.org/mod_mbox/james-server-dev/200708.mbox/[EMAIL 
>> PROTECTED] #3 
>> 3.) Drop lazy syntax checking or make it optional
>>       Mime4j has a lot of places where it detects syntax errors of the
>>       multipart stream. Currently, these are reported by a warning message,
>>       which is being logged.
>>       This behaviour is improper. Such situations should cause an
>> exception or at
>>       least the Mime4j user should be able to request that they do.
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to