From: Alexander Kriegisch Date: Sun, 10 Apr 2022 02:38:16 +0000 (+0700) Subject: Make TypeSafeEnum immutable X-Git-Tag: V1_9_19~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ecda93436b7e4e3736601a648a9f55ad19d67e0;p=aspectj.git Make TypeSafeEnum immutable Signed-off-by: Alexander Kriegisch --- diff --git a/util/src/main/java/org/aspectj/util/TypeSafeEnum.java b/util/src/main/java/org/aspectj/util/TypeSafeEnum.java index 760c2ef67..fc0de82c9 100644 --- a/util/src/main/java/org/aspectj/util/TypeSafeEnum.java +++ b/util/src/main/java/org/aspectj/util/TypeSafeEnum.java @@ -16,8 +16,8 @@ import java.io.DataOutputStream; import java.io.IOException; public class TypeSafeEnum { - private byte key; - private String name; + private final byte key; + private final String name; public TypeSafeEnum(String name, int key) { this.name = name; @@ -50,7 +50,7 @@ public class TypeSafeEnum { @Override public boolean equals(Object o) { return (o instanceof TypeSafeEnum) && - ((TypeSafeEnum)o).key == key && - ((TypeSafeEnum)o).name.equals(name); + ((TypeSafeEnum)o).key == key && + ((TypeSafeEnum)o).name.equals(name); } }