(int msgno)
| 470 | * pending new message notifications from the server. |
| 471 | */ |
| 472 | protected void checkRange(int msgno) throws MessagingException { |
| 473 | if (msgno < 1) // message-numbers start at 1 |
| 474 | throw new IndexOutOfBoundsException("message number < 1"); |
| 475 | |
| 476 | if (msgno <= total) |
| 477 | return; |
| 478 | |
| 479 | // Out of range, let's ping the server and see if |
| 480 | // the server has more messages for us. |
| 481 | |
| 482 | synchronized(messageCacheLock) { // Acquire lock |
| 483 | try { |
| 484 | keepConnectionAlive(false); |
| 485 | } catch (ConnectionException cex) { |
| 486 | // Oops, lost connection |
| 487 | throw new FolderClosedException(this, cex.getMessage()); |
| 488 | } catch (ProtocolException pex) { |
| 489 | throw new MessagingException(pex.getMessage(), pex); |
| 490 | } |
| 491 | } // Release lock |
| 492 | |
| 493 | if (msgno > total) // Still out of range ? Throw up ... |
| 494 | throw new IndexOutOfBoundsException(msgno + " > " + total); |
| 495 | } |
| 496 | |
| 497 | /* |
| 498 | * Check whether the given flags are supported by this server, |
no test coverage detected