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 171777 - [68cat] [editor] Insert code should use property access in @Entities
Summary: [68cat] [editor] Insert code should use property access in @Entities
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-09 06:45 UTC by michbarsinai
Modified: 2010-01-11 02:12 UTC (History)
0 users

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 michbarsinai 2009-09-09 06:45:42 UTC
[ BUILD # : 200909081533 ]
[ JDK VERSION : 1.6.* ]

The insert code module for hashCode() and equals() uses the actual
fields rather than the get* methods. At least for @Entity beans that
use property access, it should use the getters, as accessing the
fields directly is wrong.

IMHO, it should use getters whenever possible, as those methods get
inlined in the simple cases. Maybe we could have a checkbox marked
"Use property access"?

Michael
Comment 1 michbarsinai 2009-09-09 14:42:40 UTC
While at it, the module should probably allow the user to choose from class identity check (this.getClass ==
other.getClass) and the instanceof operator, as the JPA providers use bytecode weaving.