()
| 1643 | * Load this message's Flags |
| 1644 | */ |
| 1645 | private synchronized void loadFlags() throws MessagingException { |
| 1646 | if (flags != null) |
| 1647 | return; |
| 1648 | |
| 1649 | // Acquire MessageCacheLock, to freeze seqnum. |
| 1650 | synchronized(getMessageCacheLock()) { |
| 1651 | try { |
| 1652 | IMAPProtocol p = getProtocol(); |
| 1653 | |
| 1654 | // This message could be expunged when we were waiting |
| 1655 | // to acquire the lock ... |
| 1656 | checkExpunged(); |
| 1657 | |
| 1658 | flags = p.fetchFlags(getSequenceNumber()); |
| 1659 | // make sure flags is always set, even if server is broken |
| 1660 | if (flags == null) |
| 1661 | flags = new Flags(); |
| 1662 | } catch (ConnectionException cex) { |
| 1663 | throw new FolderClosedException(folder, cex.getMessage()); |
| 1664 | } catch (ProtocolException pex) { |
| 1665 | forceCheckExpunged(); |
| 1666 | throw new MessagingException(pex.getMessage(), pex); |
| 1667 | } |
| 1668 | } // Release MessageCacheLock |
| 1669 | } |
| 1670 | |
| 1671 | /* |
| 1672 | * Are all headers loaded? |
no test coverage detected