diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-04-10 09:38:16 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-04-10 09:38:46 +0700 |
commit | 1ecda93436b7e4e3736601a648a9f55ad19d67e0 (patch) | |
tree | 6d86af92df25a09225b0005764dd15d6c23792a1 /util/src/main | |
parent | 48edd62b2331904425944ed605ee8c1d4956b3b7 (diff) | |
download | aspectj-1ecda93436b7e4e3736601a648a9f55ad19d67e0.tar.gz aspectj-1ecda93436b7e4e3736601a648a9f55ad19d67e0.zip |
Make TypeSafeEnum immutable
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'util/src/main')
-rw-r--r-- | util/src/main/java/org/aspectj/util/TypeSafeEnum.java | 8 |
1 files changed, 4 insertions, 4 deletions
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); } } |