From 1ecda93436b7e4e3736601a648a9f55ad19d67e0 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 10 Apr 2022 09:38:16 +0700 Subject: Make TypeSafeEnum immutable Signed-off-by: Alexander Kriegisch --- util/src/main/java/org/aspectj/util/TypeSafeEnum.java | 8 ++++---- 1 file 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); } } -- cgit v1.2.3