classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-javamail] IMAPFolder type issue


From: Chris Burdess
Subject: [Classpathx-javamail] IMAPFolder type issue
Date: Mon, 14 Feb 2005 20:05:32 +0000

Neil Campbell wrote:
In IMAPFolder.getType(), as well as in IMAPFolder.getFolders(), the type is assigned to be either HOLDS_MESSAGES or HOLDS_FOLDERS. However, I note that the Sun implementation differs, in that a folder can hold both messages and
folders.

I'm not familiar enough with the IMAP protocol to know which is correct, but I think your implementation can be made to behave the same way as Sun's in this
case by changing:

type = entries[0].isNoinferiors() ?
    Folder.HOLDS_MESSAGES :
    Folder.HOLDS_FOLDERS;

to something along the lines of

type = 0;

if(!entries[0].isNoinferiors()) {
 type |= Folder.HOLDS_FOLDERS;
}
if(!entries[0].isNoselect()) {
 type |= Folder.HOLDS_MESSAGES;
}

in both cases.  Similarly, I suppose that in create(int type) the line:
if (type == HOLDS_FOLDERS)

should be:
if ((type & HOLDS_FOLDERS) != 0)

Does this seem reasonable?

Absolutely. Patch applied.
--
Chris Burdess





reply via email to

[Prev in Thread] Current Thread [Next in Thread]