X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FEye.java;h=59612440812c342dd6dd929b91936de79363d337;hb=480ff9f544cf66c5ee99268f4677a0b389815538;hp=6b71f354d6cd9e3d8a7bb043680efda045a1b573;hpb=7403fee4ac1128c68cab110835e4f3bc430a7eed;p=Persons_Comparator.git diff --git a/src/Eye.java b/src/Eye.java index 6b71f35..5961244 100644 --- a/src/Eye.java +++ b/src/Eye.java @@ -27,7 +27,7 @@ public class Eye implements Comparable { if (validateColor(strColor)) { this.strColor = strColor; } else { - throw new IllegalArgumentException("Color must be" + new Eye().colorListToString()); + throw new IllegalArgumentException("Color must be" + this.colorListToString()); } } @@ -51,9 +51,8 @@ public class Eye implements Comparable { this.color = new Color(88, 41, 0); else this.color = Color.getColor(color); - } else { - throw new IllegalArgumentException("Color must be" + new Eye().colorListToString()); + throw new IllegalArgumentException("Color must be" + this.colorListToString()); } }