Skip to content

Commit

Permalink
typesafety: UserList.getUsers()
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Gorzinski <17914061+ThePrez@users.noreply.github.com>
  • Loading branch information
ThePrez committed May 2, 2023
1 parent 9e1815b commit 13c3878
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/ibm/as400/access/UserEnumeration.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// Helper class. Used to wrap the User[] with an Enumeration.
// This class is used by UserList.
class UserEnumeration implements Enumeration
class UserEnumeration implements Enumeration<User>
{
// The user list object from which to get the users.
private UserList list_ = null;
Expand Down Expand Up @@ -48,7 +48,7 @@ public final boolean hasMoreElements()
return counter_ < length_;
}

public final Object nextElement()
public final User nextElement()
{
if (counter_ >= length_)
{
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/ibm/as400/access/UserList.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import java.beans.VetoableChangeSupport;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

/**
Represents a list of user profiles on the system.
Expand Down Expand Up @@ -372,7 +374,7 @@ public String getUserProfile()
@see #close
@see #load
**/
public synchronized Enumeration getUsers() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, RequestNotSupportedException
public synchronized Enumeration<User> getUsers() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, RequestNotSupportedException
{
if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Retrieving user list.");
// Need to get the length.
Expand Down

0 comments on commit 13c3878

Please sign in to comment.