Digging into it, I don't really get the setSendDate() being public
either. I lean towards it being private as well. Also, why can't
we return null? The logic in getSendDate() seems odd.. If you
haven't sent the email, then it should be null:
public Date getSentDate(){
return sentDate;
}
I am not sure about the toLowerCase().. The line you referenced
doesn't seem to deal with headers, but, if you want to make the
change, go ahead. and I'll be happy to post (and tag!) an RC7.
Cheers,
Eric
On Aug 25, 2005, at 6:38 AM, Henning P. Schmiedehausen wrote:
Hi,
I've added a findbugs task to the email build and it has a few things
to report. We might discuss a little bit whether it is worth to work
on this:
Email.java 911, 926: externally mutable object
This is correct. The date object could be changed after it was put
into the Email object. Personally I consider this a minor
issue. Change would be
public void setSentDate(Date date) {
this.sentDate = (date == null) ? new Date() : new Date
(date.getTime());
}
public Date getSentDate() {
if (this.sentDate == null) {
return new Date();
else
return new Date(this.sentDate.getTime());
}
(IMHO, sentDate should be private, not protected. Then you could omit
the test in the getSentDate method)
Email.java 286: dubious String.toLowerCase()
Correct, too. As Mail headers are defined as US-ASCII (according to
RFC 2822, 2.1 General Description), we could use explicit US-ASCII
coding.
Email.java: Field not initialized in constructor:
org.apache.commons.mail.Email.session
Hm. We have lots of these. Why does Findbugs nag about that one?
Email.java 426
MultiPartEmail 295
HtmlEmail 195 catches Exception, but Exception is not thrown in
the
try block and RuntimeException is not explicitly
caught
False positives IMHO. There are a few Exceptions inside these blocks
that derive from Exception.
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
[EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/
RedHat Certified Engineer -- Jakarta Turbine Development -- hero
for hire
Linux, Java, perl, Solaris -- Consulting, Training, Development
4 - 8 - 15 - 16 - 23 - 42
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]