diff --git a/src/main/java/com/ibm/as400/access/MessageQueue.java b/src/main/java/com/ibm/as400/access/MessageQueue.java index 0f18e8b7f..03c5a5103 100644 --- a/src/main/java/com/ibm/as400/access/MessageQueue.java +++ b/src/main/java/com/ibm/as400/access/MessageQueue.java @@ -449,7 +449,7 @@ public boolean getListDirection() @exception IOException If an error occurs while communicating with the system. @exception ObjectDoesNotExistException If the object does not exist on the system. **/ - public Enumeration getMessages() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException + public Enumeration getMessages() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException { if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Retrieving message queue message list."); // Need to get the length. diff --git a/src/main/java/com/ibm/as400/access/QueuedMessageEnumeration.java b/src/main/java/com/ibm/as400/access/QueuedMessageEnumeration.java index 1f27084dd..06b569b4c 100644 --- a/src/main/java/com/ibm/as400/access/QueuedMessageEnumeration.java +++ b/src/main/java/com/ibm/as400/access/QueuedMessageEnumeration.java @@ -17,7 +17,7 @@ import java.util.NoSuchElementException; // Helper class. Used to wrap the QueuedMessage[] with an Enumeration. This class is used by MessageQueue and JobLog. -class QueuedMessageEnumeration implements Enumeration +class QueuedMessageEnumeration implements Enumeration { private QueuedMessage[] messageCache_; @@ -51,12 +51,13 @@ class QueuedMessageEnumeration implements Enumeration numMessages_ = length; } + @Override public final boolean hasMoreElements() { return counter_ < numMessages_; } - - public final Object nextElement() + @Override + public final QueuedMessage nextElement() { if (counter_ >= numMessages_) {