Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335658

Summary: [hashcode/equals] Should not warn when class has no fields and superclass implements methods
Product: [Eclipse Project] JDT Reporter: Aristónico Silvano Negro Diez <arisnegro>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P4 CC: daniel_megert, markus.kell.r, Olivier_Thomann
Version: 3.5.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Aristónico Silvano Negro Diez CLA 2011-01-28 03:03:33 EST
Hi!

The option Source -> Generate hashCode() and equals() shows one alert when one attribute selected in the list don't defined the methods equals() or hashCode().

The alert says "The field type '....' does not implement equals() and hashCode() - the resulting code may not work correctly".

But exist one exception. When the class which not defined the methods equals() or hashCode() has no attributes, this alert makes no sense.
It should look for the methods equals() or hashCode() in the super class.

Bye!


-- Configuration Details --
Product: Eclipse 1.2.2.20100122-1337 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.jdt 3.5.2.r352_v20100108-7r88FEwFI0WTuoBl0iaG0tyhfZH6
Comment 1 Olivier Thomann CLA 2011-01-28 12:19:21 EST
Move to JDT/UI
Comment 2 Markus Keller CLA 2011-02-02 10:59:12 EST
Agreed.