Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typesafety: UserList.getUsers() #46

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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