[ 
https://issues.apache.org/jira/browse/MIME4J-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519228
 ] 

Stefano Bagnara commented on MIME4J-23:
---------------------------------------

In the event patch I see a minor issue:
+    /**
+     * Logs (at debug) an indicative message based on the given event
+     * and the current state of the system.
+     * @param event <code>Event</code>, not null
+     */
+    protected void debug(Event event) {
+        if (log.isWarnEnabled()) {
+            log.warn(message(event));
+        }
+    }
should be isDebug enabled and log.debug.

Furthermore in the message method I would prefer if the standard code and the 
code in the catch used the same strings for the error. In fact the only 
difference should be having the line number or not:

protected String message(Event event) {
    String result;
    if (event == null) {
        result = "Event is unexpectedly null.";
    } else {
        result = event.toString();
        try {
            result = "Line " + cursor.getLineNumber() + ": " + result;
        } catch (IOException e) {
            log.debug("Cannot get line number for message", e);
        }
    }
    return result;
}

Then I would change the text for the 2 events to the full text you used in the 
message() if/then/else.

About the "TODO consider adding a severity indication to Event" I think that 
while we have only this 2 events using warn for both is ok.


> [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-event.patch, 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to