mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 08:58:26 +00:00
* Fix comment typo #2325 * Minor enchancements to flyweight #2326 * Minor enchancements to flyweight #2326
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user