fixed issue so that UserGroup stays as a singleton instance so that all users are stored in it properly
This commit is contained in:
1 parent
eb233f43f9
commit
1ea89164f4
2 files changed
+18
-7
No files matched your search
@@ -4,14 +4,21 @@ import java.util.ArrayList;
|
||||
|
||||
public class UserGroup {
|
||||
|
||||
private static ArrayList<User> users;
|
||||
private static UserGroup instance;
|
||||
private ArrayList<User> users;
|
||||
|
||||
private UserGroup() {
|
||||
users = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static UserGroup getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new UserGroup();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static ArrayList<User> getUsers() {
|
||||
public ArrayList<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user