Skip to content

Commit

Permalink
TypeSafety added - Issue fixed #40
Browse files Browse the repository at this point in the history
Signed-off-by: Sumit Dethe <91131672+sumitdethe27@users.noreply.github.com>
  • Loading branch information
sumitdethe27 committed Jun 8, 2023
1 parent 06c1039 commit 8a46481
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/ibm/as400/access/MessageQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<QueuedMessage> getMessages() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
{
if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Retrieving message queue message list.");
// Need to get the length.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QueuedMessage>
{
private QueuedMessage[] messageCache_;

Expand Down Expand Up @@ -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_)
{
Expand Down

0 comments on commit 8a46481

Please sign in to comment.