-
1. Re: Small bug in org.jboss.mail.mailbox.MessageData
sappenin Mar 8, 2006 2:27 PM (in response to sappenin)Hmmm....the forum is stripping out my array brackets.
The fix should look like this:/** * take a set of addresses and turn them into a semi colon seperated string * * @param address * @return string containing the addresses */ private String semiColize(MailAddress[] address) { String retval = ""; for (int i = 0; i < address.length; i++) { retval += retval.length() == 0 ? address{i}.toString() : ("; " + address{i}.toString()); } return retval; }
-
2. Re: Small bug in org.jboss.mail.mailbox.MessageData
sappenin Mar 9, 2006 1:25 PM (in response to sappenin)Thanks for adding the chage in CVS. Although, it looks like only half of the changes made it in. In its current state, the "for" loop is going to replace the value of retval with a new string on every iteration.
Instead, each new address from the address[] array should be appended, so that all addresses are returned by the function.
Current CVS code://Bug: 'retval' will end up with only the last address // since an assignment operation is being performed // instead of an append retval = retval.length() == 0 ? address{i}.toString() : ("; " + address{i}.toString());
Suggested Fix://Append into 'retval' using '+=' instead of just '=' //or perhaps by using a StringBuffer(?) for better efficiency retval += retval.length() == 0 ? address{i}.toString() : ("; " + address{i}.toString());
-
3. Re: Small bug in org.jboss.mail.mailbox.MessageData
acoliver Mar 9, 2006 1:36 PM (in response to sappenin)doh.. . I'm an idiot. Thanks for checking me :-)
-
4. Re: Small bug in org.jboss.mail.mailbox.MessageData
f00bar Mar 13, 2006 9:51 AM (in response to sappenin)I had to de-type the flags field in MessageData in order to get it to compile. I just did a cvs upd to pull the source tree. Is it possible that you didn't commit a file called Flag.java in the same namespace as MessageData, or am I missing something?
BTW, is there a better way to report stuff like this than post to the BB? -
5. Re: Small bug in org.jboss.mail.mailbox.MessageData
acoliver Mar 13, 2006 10:38 AM (in response to sappenin)jira. Yes...if I failed to commit flag to head then that is my bad. I'll check.