refactoring: Issues #2326 and #2325 (#2327)

* Fix comment typo #2325

* Minor enchancements to flyweight #2326

* Minor enchancements to flyweight #2326
This commit is contained in:
Stefanel Stan
2022-11-20 13:14:13 +00:00
committed by GitHub
parent 3a446f8e9c
commit a05cf33643
3 changed files with 7 additions and 10 deletions
@@ -48,7 +48,7 @@ public class UserGroup {
*/
public static void addUserToFreeGroup(final User user) throws IllegalArgumentException {
if (paidGroup.contains(user)) {
throw new IllegalArgumentException("User all ready member of paid group.");
throw new IllegalArgumentException("User already member of paid group.");
} else {
if (!freeGroup.contains(user)) {
freeGroup.add(user);
@@ -65,7 +65,7 @@ public class UserGroup {
*/
public static void addUserToPaidGroup(final User user) throws IllegalArgumentException {
if (freeGroup.contains(user)) {
throw new IllegalArgumentException("User all ready member of free group.");
throw new IllegalArgumentException("User already member of free group.");
} else {
if (!paidGroup.contains(user)) {
paidGroup.add(user);