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.
For the hashCode Builder please currently it will be generates like this: int hash = 3; hash = 97 * hash + Objects.hashCode(this.var1); hash = 97 * hash + Objects.hashCode(this.var2); return hash; .) please make the 97 to be exported into a variable; .) Add a 'hash = super.hashCode()' in the beginning if the current object extends from another one. Same for equals() Product Version = NetBeans IDE 7.3 (Build 201302132200) Operating System = Linux version 3.8.0-26-generic running on amd64 Java; VM; Vendor = 1.7.0_25 Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01
I guess it would not harm anything (and would help to improve code quality as seen by automated checkers) to add a variable for the multiplier. I would personally be very careful not to encourage overriding (non-default) equals&hashCode, so I would generally vote for not generating the super call - if the user needs that, then its simple to do manually, and it is more probable the user will ensure the sub- and super-class play nicely together when doing this manually.
Hmmm, good point, maybe for the sake of quicker implementation you could add an uncommented // hash = super.hashCode() Then you just need to uncomment it if you want it :)