Project: JDT
Bug 176293 [hashcode/equals] Generate Equals/HashCode for a non-static inner class ignores outer class
Reported: 2007-03-03 13:39:10 | Status: resolved fixed

Build ID: M20060921-0945 Steps To Reproduce: 1. Create an outer class and a (non-static) inner class 2. give the outer class a few fields and the inner class as well. 3. Create equals/hashCode for the outer class (optional, but does not help) 4. Create equals/hashCode for the inner class Actual result: equals/hashCode ignore that the outer class exists - neither the outer class's fields nor its equals() method is called. If the inner class does not have any fields on its own, creating equals/hashcode is impossible. Expected result: Either the fields of the outer class or the outer instance itself (or its equals method) is listed in the field selector dialog. Workaround: Refactor the inner class to toplevel first, then you can select the (now explicit) outer class field.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java