In my IntelliJ IDEA 15 (build 143.382), the context menu invoked via "Code > Generate" is missing the "equals() and hashCode()" entry. How can I configure the context menu contents to bring it back?
Asked
Active
Viewed 1,559 times
1 Answers
17
My bad, turns out the contents are context-sensitive: I was invoking the menu from a class which didn't have any instance fields...

Rahel Lüthy
- 6,837
- 3
- 36
- 51
-
1Sometimes, the tools are almost too smart for us... ;-) – Freek de Bruijn Dec 01 '15 at 15:58
-
5Well, not sure if this is really "smart", I would prefer the menu item to just be disabled rather than absent... – Rahel Lüthy Dec 03 '15 at 06:06
-
You are right, that would be clearer. The disabled menu items could even show a tool tip explaining the situation. – Freek de Bruijn Dec 03 '15 at 07:37
-
2Even though, if a class inherits from another class (which overwrites equals), shouldn't the subclass also override it to enable that only the instances of the subtype are equal? – koppor Feb 05 '18 at 06:51
-
@FreekdeBruijn i want to use properties instead. – Alex78191 Aug 10 '18 at 12:15
-
3Seems also to happen if your class does not have any fields but the extended class does ... – Zarathustra Jan 18 '19 at 19:09