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 167992 - Would like generated (Java) equals() to be different
Summary: Would like generated (Java) equals() to be different
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-01 20:48 UTC by tossup
Modified: 2010-01-11 02:11 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tossup 2009-07-01 20:48:15 UTC
I have a situation where the code generated by NetBeans for the (Java) equals() method needs to be different.  For
example, 6.5.1 currently generates something like the following for a String:

  if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { return false; }

I need

  if ((this.name == null) ? (other.getName() != null) : !this.name.equals(other.getName()) { return false; }

This happens because some instrumented instances (think Hibernate/javassist) seem to be typed as
'ClassName_$$_javassist_NN' (where NN is some number) rather than 'ClassName'.  (Yes, I know that I'm chasing the wrong
problem with the above, but until I figure out what the root cause is, this is what I'm left with.)  Any idea as to when
"generated code" might be "template-able" like templates?