commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <>
Subject [email] Findbugs
Date Thu, 25 Aug 2005 10:38:40 GMT

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: 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();
    return new Date(this.sentDate.getTime());

(IMHO, sentDate should be private, not protected. Then you could omit
the test in the getSentDate method) 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. Field not initialized in constructor: org.apache.commons.mail.Email.session

Hm. We have lots of these. Why does Findbugs nag about that one? 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.


Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH        +49 9131 50 654 0

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:
For additional commands, e-mail:

View raw message