classpathx-javamail
[Top][All Lists]
Advanced

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

[Classpathx-javamail] IMAPFolder type issue


From: Neil Campbell
Subject: [Classpathx-javamail] IMAPFolder type issue
Date: Sun, 19 Dec 2004 00:51:24 +0000
User-agent: KMail/1.7.1

Hi everyone,

I've been playing around with the ClasspathX JavaMail implementation and using 
it with my application as a replacement for the Sun version.

So far I'm very impressed, although I have spotted a possible issue with the 
IMAPFolder.

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?

Cheers,
Neil




reply via email to

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