|
|
@ -149,14 +149,7 @@ public class SignUpGUI extends JFrame implements ActionListener { |
|
|
|
// Function to check if the input username doesn't already exist in the JSON file |
|
|
|
private boolean isUsernameAvailable(String filename, String username) { |
|
|
|
List<CreateUser> userList = CreateUser.readUserListFromJsonFile(filename); |
|
|
|
if (userList != null) { |
|
|
|
for (CreateUser user : userList) { |
|
|
|
if (user.getUserName().equals(username)) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return userList == null || userList.stream().noneMatch(user -> user.getUserName().equals(username)); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|