This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 162991 - [67cat] equals/hashcode generator support for contract between methods
Summary: [67cat] equals/hashcode generator support for contract between methods
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2009-04-17 23:04 UTC by dynamite
Modified: 2013-06-06 13:52 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description dynamite 2009-04-17 23:04:53 UTC
[ BUILD # : 200904170201 ]
[ JDK VERSION : 1.6.* ]

Object.equals specifies that any objects that are equal should also
have the same hashCode.  The NetBeans "equals() and hashCode()"
generator (accessed via alt-insert) allows the user to select
combinations of class properties that would violate this contract
between these methods.

I propose that any field in the hashCode side of the selection is
disabled and greyed-out until it is selected on the equals side. 
This would ensure that user do not errantly create incompatible
equals() and hashCode() methods.
Comment 1 hupfdule 2012-10-01 12:12:15 UTC
Sounds like a good idea to me.
Any plans on including this in netbeans?
Comment 2 tomzi 2013-06-06 13:52:33 UTC
It would be great if could select if I could select which implementation should be selected:
-) normal string concatination
-) or ToHashCodeBuilder, ToEqualsBuilder....